/**
 * Styles de l'interface de pointage (front-end)
 * Plugin: bnef-pointage
 */

/* Reset et base */
.bnef-pointage-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 500px;
    margin: 20px auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.bnef-pointage-container *,
.bnef-pointage-container *::before,
.bnef-pointage-container *::after {
    box-sizing: border-box;
}

/* Card */
.bnef-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

/* Title */
.bnef-title {
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
}

/* Header */
.bnef-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.bnef-employee-name {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Status */
.bnef-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bnef-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #9ca3af;
}

.bnef-status-indicator.status-idle {
    background: #9ca3af;
}

.bnef-status-indicator.status-working {
    background: #10b981;
    animation: pulse 2s infinite;
}

.bnef-status-indicator.status-paused {
    background: #f59e0b;
    animation: pulse 2s infinite;
}

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

.bnef-status-text {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
}

/* Server time */
.bnef-server-time {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 25px;
}

.bnef-server-time span {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
    font-weight: 500;
}

/* Timers */
.bnef-timers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.bnef-timer-block {
    background: #f3f4f6;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.bnef-timer-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.bnef-timer-value {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

/* Chrono principal "Temps de travail" */
.bnef-timer-work {
    background: #dbeafe;
}

.bnef-timer-work .bnef-timer-value {
    color: #1d4ed8;
    font-size: 32px;
}

.bnef-timer-pause {
    background: #fef3c7;
}

.bnef-timer-pause .bnef-timer-value {
    color: #d97706;
}

.bnef-timer-pause-total {
    background: #e0e7ff;
}

.bnef-timer-pause-total .bnef-timer-value {
    color: #4f46e5;
}

/* Temps restant de pause */
.bnef-timer-pause-remaining {
    background: #fef3c7;
}

.bnef-timer-pause-remaining .bnef-timer-value {
    color: #d97706;
}

.bnef-timer-pause-remaining.exceeded {
    background: #fee2e2;
}

.bnef-timer-pause-remaining.exceeded .bnef-timer-value {
    color: #dc2626;
}

.bnef-timer-pause-remaining.exceeded .bnef-timer-label {
    color: #dc2626;
}

/* Form */
.bnef-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bnef-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bnef-form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.bnef-form-group select,
.bnef-form-group input {
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bnef-form-group select:focus,
.bnef-form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bnef-form-group input[type="password"] {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
    letter-spacing: 5px;
    text-align: center;
}

/* Buttons */
.bnef-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.bnef-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bnef-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.bnef-btn-large {
    padding: 16px 32px;
    font-size: 18px;
    width: 100%;
}

.bnef-btn-primary {
    background: #3b82f6;
    color: #ffffff;
}

.bnef-btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.bnef-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.bnef-btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

.bnef-btn-success {
    background: #10b981;
    color: #ffffff;
}

.bnef-btn-success:hover:not(:disabled) {
    background: #059669;
}

.bnef-btn-warning {
    background: #f59e0b;
    color: #ffffff;
}

.bnef-btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.bnef-btn-info {
    background: #06b6d4;
    color: #ffffff;
}

.bnef-btn-info:hover:not(:disabled) {
    background: #0891b2;
}

.bnef-btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.bnef-btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

/* Actions */
.bnef-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Messages */
.bnef-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.bnef-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.bnef-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.bnef-message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Summary */
.bnef-summary {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.bnef-summary h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.bnef-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.bnef-summary-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.bnef-summary-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.bnef-summary-value {
    display: block;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* Loader */
.bnef-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.bnef-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Screen visibility */
.bnef-screen {
    display: block;
}

.bnef-screen[style*="display: none"] {
    display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
    .bnef-pointage-container {
        padding: 0 10px;
    }
    
    .bnef-card {
        padding: 20px;
    }
    
    .bnef-timers {
        grid-template-columns: 1fr;
    }
    
    .bnef-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .bnef-timer-value {
        font-size: 20px;
    }
    
    .bnef-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* ============================================
   SIGNALER UN PROBLÈME
   ============================================ */

.bnef-report-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.bnef-btn-link {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px 10px;
}

.bnef-btn-link:hover {
    color: #374151;
}

/* Modal */
.bnef-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bnef-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.bnef-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.bnef-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.bnef-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.bnef-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.bnef-modal-close:hover {
    color: #374151;
}

.bnef-modal-body {
    padding: 20px;
}

.bnef-modal-body .bnef-form-group {
    margin-bottom: 15px;
}

.bnef-modal-body textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.bnef-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
}

/* ============================================
   RESPONSIVE MOBILE - POINTAGE
   ============================================ */
@media screen and (max-width: 480px) {
    .bnef-pointage-container {
        padding: 10px;
    }
    
    .bnef-card {
        padding: 15px;
        border-radius: 12px;
    }
    
    .bnef-title {
        font-size: 20px;
    }
    
    /* Formulaire login */
    .bnef-form-group label {
        font-size: 14px;
    }
    
    .bnef-form-group select,
    .bnef-form-group input {
        font-size: 16px;
        padding: 14px;
        border-radius: 10px;
    }
    
    /* Boutons plus gros et tactiles */
    .bnef-btn {
        min-height: 50px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .bnef-btn-large {
        min-height: 60px;
        font-size: 18px;
    }
    
    .bnef-btn-small {
        min-height: 40px;
        font-size: 14px;
    }
    
    /* Header avec nom */
    .bnef-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .bnef-employee-name {
        font-size: 18px;
    }
    
    /* Status */
    .bnef-status {
        padding: 12px;
        font-size: 16px;
    }
    
    .bnef-status-indicator {
        width: 14px;
        height: 14px;
    }
    
    /* Timers */
    .bnef-timers {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bnef-timer-block {
        padding: 15px;
    }
    
    .bnef-timer-label {
        font-size: 13px;
    }
    
    .bnef-timer-value {
        font-size: 28px;
    }
    
    /* Boutons actions */
    .bnef-actions {
        gap: 12px;
    }
    
    /* Résumé */
    .bnef-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .bnef-summary-item {
        padding: 12px;
    }
    
    /* Modal mobile */
    .bnef-modal-content {
        width: 95%;
        max-width: none;
        margin: 15px;
        border-radius: 16px;
    }
    
    .bnef-modal-header {
        padding: 15px;
    }
    
    .bnef-modal-header h3 {
        font-size: 16px;
    }
    
    .bnef-modal-body {
        padding: 15px;
    }
    
    .bnef-modal-body select,
    .bnef-modal-body input,
    .bnef-modal-body textarea {
        font-size: 16px;
        padding: 12px;
    }
    
    .bnef-modal-footer {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .bnef-modal-footer .bnef-btn {
        width: 100%;
    }
    
    /* Bouton signaler problème */
    .bnef-report-section {
        margin-top: 15px;
        padding-top: 15px;
    }
    
    .bnef-btn-link {
        font-size: 14px;
        padding: 10px;
    }
}
