/* ============================================
   BUSINESS TIME RECRUITER - STYLES
   ============================================ */

/* ============= RESET & BASE ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ccbca2;
    color: #2c3e50;
    line-height: 1.6;
}

/* ============= HEADER ============= */
.header {
    background: #ccbca2;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 24px;
    color: #667eea;
    margin: 0;
}

.header h1 a {
    text-decoration: none;
    color: inherit;
}

.header h1 img {
    height: 90px;
    vertical-align: middle;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #27ae60;
}

.user-logout {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #e74c3c;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
}

.user-logout:hover {
    color: #c0392b;
    text-decoration: underline;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============= CONTAINER ============= */
.container {
    margin: 30px auto;
    padding: 0 20px;
}

/* ============= STATS CARDS ============= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
}

/* ============= FILTERS BAR ============= */
.filters-bar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filters-bar input[type="text"] {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filters-bar input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filters-bar select {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters-bar select:hover,
.filters-bar select:focus {
    border-color: #667eea;
    outline: none;
}

/* ============= BUTTONS ============= */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.4);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.4);
}

/* ============= TABLE ============= */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.tabulator {
    font-size: 14px;
}

.tabulator-cell {
    font-size: 14px;
    padding: 10px;
}

.tabulator-row .tabulator-cell {
    vertical-align: middle !important;
    line-height: 1.4;
}

.tabulator-row {
    height: 48px;
}

.tabulator-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.tabulator-header .tabulator-col {
    border-right: 1px solid rgba(255,255,255,0.1);
}

.tabulator-row {
    transition: background 0.2s ease;
}

.tabulator-row:hover {
    background: #f8f9fa !important;
}

.tabulator-row.tabulator-row-even {
    background-color: #fafbfc;
}

/* ============= BADGES ============= */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-nouveau {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-venu-1 {
    background: #fff3e0;
    color: #f57c00;
}

.badge-venu-2 {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-reflexion {
    background: #fff9c4;
    color: #f57f17;
}

.badge-pas-interesse {
    background: #ffebee;
    color: #d32f2f;
}

/* ============= ACTION ICONS ============= */
.action-icons {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    vertical-align: middle;
}

.action-icon {
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 2px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.action-icon:hover {
    transform: scale(1.15);
    background: rgba(102, 126, 234, 0.1);
}

.icon-linkedin {
    text-decoration: none !important;
}

/* ============= MOBILE CARDS ============= */
.mobile-cards {
    display: none;
}

.contact-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.contact-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.contact-name {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.contact-info {
    margin-bottom: 15px;
}

.contact-info-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 14px;
}

.contact-info-label {
    font-weight: 600;
    margin-right: 8px;
    min-width: 100px;
    color: #7f8c8d;
}

.contact-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.contact-actions button,
.contact-actions a {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    text-decoration: none;
}

/* ============= MODAL ============= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 25px;
    max-width: 900px;
    width: 90%;
    max-height: none;
    overflow: visible;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eee;
}

.modal-header h2 {
    font-size: 24px;
    color: #2c3e50;
    margin: 0;
}

.close-modal {
    font-size: 32px;
    cursor: pointer;
    color: #999;
    transition: all 0.2s ease;
    line-height: 1;
}

.close-modal:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

/* ============= FORMS ============= */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* ============= DELETE TOOLTIP ============= */
.delete-tooltip {
    position: fixed;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border-left: 4px solid #e74c3c;
    z-index: 10000;
    animation: tooltipFadeIn 0.2s ease;
    max-width: 250px;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.delete-tooltip span {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
}

.delete-tooltip-buttons {
    display: flex;
    gap: 10px;
}

.tooltip-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tooltip-yes {
    background: #e74c3c;
    color: white;
}

.tooltip-yes:hover {
    background: #c0392b;
}

.tooltip-no {
    background: #95a5a6;
    color: white;
}

.tooltip-no:hover {
    background: #7f8c8d;
}

/* ============= NOTIFICATION TOOLTIP ============= */
.notification-tooltip {
    position: fixed;
    top: 90px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 10001;
    animation: notificationSlideIn 0.3s ease;
    font-weight: 600;
}

.notification-tooltip.error {
    background: #e74c3c;
}

@keyframes notificationSlideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============= SMS PREVIEW ============= */
.sms-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #3498db;
}

.sms-preview strong {
    display: block;
    margin-bottom: 10px;
}

.sms-preview p {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 13px;
    color: #555;
}

.sms-counter {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.sms-counter.warning {
    color: #f39c12;
    font-weight: bold;
}

.sms-counter.error {
    color: #e74c3c;
    font-weight: bold;
}

/* ============= HISTORIQUE ============= */
.history-timeline {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px 0;
}

.history-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
}

.history-entry:last-child {
    border-bottom: none;
}

.history-entry:hover {
    background: #f8f9fa;
}

.history-icon {
    font-size: 16px;
    min-width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.history-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-date {
    font-size: 12px;
    color: #7f8c8d;
    white-space: nowrap;
    min-width: 130px;
}

.history-detail {
    font-size: 13px;
    color: #2c3e50;
    flex: 1;
}

/* ============= DARK MODE TOGGLE ============= */
.dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    font-size: 24px;
}

.dark-mode-toggle:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

/* ============= DARK MODE ============= */
body.dark-mode {
    background: #4c5f44;
    color: #eaeaea;
}

body.dark-mode .header {
    background: #4c5f44;
}

body.dark-mode .user-profile {
    background: #2d3748;
}

body.dark-mode .user-profile:hover {
    background: #374151;
}

body.dark-mode .user-name {
    color: #eaeaea;
}

body.dark-mode .user-status {
    color: #48bb78;
}

body.dark-mode .user-logout {
    color: #fc8181;
}

body.dark-mode .user-logout:hover {
    color: #f56565;
}

body.dark-mode .stat-card,
body.dark-mode .filters-bar,
body.dark-mode .table-container,
body.dark-mode .contact-card,
body.dark-mode .modal-content {
    background: #1a202c;
    color: #eaeaea;
}

body.dark-mode .stat-label,
body.dark-mode .contact-info-label {
    color: #a0aec0;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #2d3748;
    border-color: #4a5568;
    color: #eaeaea;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    border-color: #667eea;
}

body.dark-mode .tabulator-row {
    background: #1a202c;
    color: #eaeaea;
}

body.dark-mode .tabulator-row:hover {
    background: #2d3748 !important;
}

body.dark-mode .tabulator-row.tabulator-row-even {
    background: #1e293b;
}

/* ============= DARK MODE - TABULATOR HEADER & FOOTER ============= */

body.dark-mode .tabulator-header {
    background: #1a202c !important;
    border-color: #4a5568 !important;
}

body.dark-mode .tabulator-header .tabulator-col {
    background: #1a202c !important;
    border-color: #4a5568 !important;
    color: #eaeaea !important;
}

body.dark-mode .tabulator-header .tabulator-col:hover {
    background: #2d3748 !important;
}

body.dark-mode .tabulator-footer {
    background: #1a202c !important;
    border-color: #4a5568 !important;
    color: #eaeaea !important;
}

body.dark-mode .tabulator-footer .tabulator-page {
    background: #2d3748 !important;
    color: #eaeaea !important;
    border-color: #4a5568 !important;
}

body.dark-mode .tabulator-footer .tabulator-page.active {
    background: #3b82f6 !important;
    color: white !important;
}

body.dark-mode .tabulator-footer .tabulator-page:hover:not(.disabled):not(.active) {
    background: #374151 !important;
}

body.dark-mode .tabulator-footer select {
    background: #2d3748 !important;
    color: #eaeaea !important;
    border-color: #4a5568 !important;
}

body.dark-mode .history-entry {
    border-bottom-color: #4a5568;
}

body.dark-mode .history-detail {
    background: #4c5f44;
	color: #eaeaea;
}

body.dark-mode .history-date {
    color: #a0aec0;
}


body.dark-mode .sms-preview {
    background: #2d3748;
}

body.dark-mode .modal-header,
body.dark-mode .contact-card-header,
body.dark-mode .contact-actions,
body.dark-mode .form-actions {
    border-color: #4a5568;
}

body.dark-mode .delete-tooltip {
    background: #1a202c;
    color: #eaeaea;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
    }
    
    .user-profile {
        padding: 6px 12px;
    }
    
    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .user-status,
    .user-logout {
        font-size: 11px;
    }

    .container {
        margin: 15px auto;
        padding: 0 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .filters-bar {
        flex-direction: column;
        gap: 10px;
    }

    .filters-bar input,
    .filters-bar select {
        width: 100%;
        min-width: 100%;
    }

    .table-container {
        display: none;
    }

    .mobile-cards {
        display: block;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

    .dark-mode-toggle {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 28px;
    }

    .contact-actions {
        gap: 10px;
    }

    .action-icon {
        font-size: 22px;
    }
}
