/* style.css - Design moderne avec navigation par icônes en haut */

:root {
    --primary-color: #3B5998;
    --primary-dark: #2D4373;
    --primary-light: #4A6BAA;
    --success-color: #4CAF50;
    --danger-color: #E53935;
    --info-color: #42A5F5;
    --warning-color: #FFC107;
    --text-primary: #212121;
    --text-secondary: #757575;
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --border-color: #E0E0E0;
    --green-light: #E8F5E9;
    --red-light: #FFEBEE;
    --blue-light: #E3F2FD;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navbar avec titre uniquement */
.navbar {
    background: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 56px;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    height: 100%;
}

.navbar h1 {
    font-size: 20px;
    font-weight: 500;
    color: white;
    letter-spacing: 0.5px;
}

/* Navigation par icônes en haut (sous navbar) */
.icon-navigation {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 12px 2px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
}

.nav-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.3s;
    min-width: 10px;
    flex-shrink: 0;
}

.nav-icon:hover,
.nav-icon.active {
    background: var(--blue-light);
    color: var(--primary-color);
}

.nav-icon-symbol {
    font-size: 28px;
    margin-bottom: 4px;
    line-height: 1;
}

.nav-icon-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

/* Main content avec espacement pour navbar + icon nav */
.main-content {
    margin-top: 130px; /* 56px navbar + 74px icon nav */
    padding: 16px;
    min-height: calc(100vh - 130px);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Logo header */
.logo-header {
    text-align: center;
    margin-bottom: 20px;
    display: none;
}

.logo-main {
    max-width: 120px;
    height: auto;
}

/* Cards modernes */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h2, .card h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 500;
}

/* User info card */
.user-info-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 500;
}

.user-details h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.user-details p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Time display */
.time-display {
    text-align: center;
    font-size: 48px;
    font-weight: 300;
    color: var(--text-primary);
    margin: 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.time-display::before {
    content: "🕐";
    font-size: 36px;
}

/* Geolocation badge */
.geoloc-badge {
    background: var(--green-light);
    color: #2E7D32;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.geoloc-badge::before {
    content: "📍";
    font-size: 20px;
}

.geoloc-badge strong {
    font-weight: 500;
}

.geoloc-coords {
    font-size: 12px;
    color: #558B2F;
    margin-top: 4px;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background-color: var(--green-light);
    color: #2E7D32;
}

.alert-error {
    background-color: var(--red-light);
    color: #C62828;
}

.alert-info {
    background-color: var(--blue-light);
    color: #1565C0;
}

.alert-warning {
    background-color: #FFF3E0;
    color: #E65100;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
    color: var(--text-primary);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.1);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: #9E9E9E;
    color: white;
}

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

.btn-success {
    background: var(--success-color);
    color: white;
    flex: 1;
    padding: 20px;
    font-size: 18px;
    border-radius: 16px;
}

.btn-success:hover:not(:disabled) {
    background: #45A049;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    flex: 1;
    padding: 20px;
    font-size: 18px;
    border-radius: 16px;
}

.btn-danger:hover:not(:disabled) {
    background: #D32F2F;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(229, 57, 53, 0.3);
}

.btn-block {
    width: 100%;
    display: block;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Icons buttons */
.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.2s;
    color: var(--text-secondary);
}

.btn-icon:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

.btn-delete:hover {
    color: var(--danger-color);
}

/* Info grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.info-grid div {
    padding: 12px;
    background: #F5F5F5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.info-grid strong {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 80px;
}

/* Last pointage card */
.last-pointage-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--success-color);
}

.last-pointage-card h3 {
    color: var(--success-color);
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.last-pointage-card h3::before {
    content: "↗";
    font-size: 20px;
}

/* Task list */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #FAFAFA;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.task-item:hover {
    background: #F5F5F5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.task-handle {
    cursor: move;
    margin-right: 12px;
    color: #BDBDBD;
    user-select: none;
    font-size: 20px;
}

.task-content {
    flex: 1;
}

.task-label {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
}

.task-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 15px;
}

.task-actions {
    display: flex;
    gap: 8px;
}

/* Form inline */
.form-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.flex-grow {
    flex: 1;
}

/* Table */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
}

.table th,
.table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #F0F0F0;
}

.table th {
    background: #FAFAFA;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background: #FAFAFA;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 14px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 8px;
}

hr {
    border: none;
    border-top: 1px solid #E0E0E0;
    margin: 24px 0;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
}

.badge-success {
    background: var(--green-light);
    color: #2E7D32;
}

.badge-danger {
    background: var(--red-light);
    color: #C62828;
}

.badge-warning {
    background: #FFF3E0;
    color: #E65100;
}

.badge-info {
    background: var(--blue-light);
    color: #1565C0;
}

/* Form row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-form .form-group label {
    font-size: 13px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.stat-value {
    font-size: 32px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 8px;
    font-weight: 400;
}

.stat-success .stat-value {
    color: var(--success-color);
}

.stat-danger .stat-value {
    color: var(--danger-color);
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
}

/* Link button */
.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Login page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--primary-color);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.logo-container {
    text-align: center;
    margin-bottom: 32px;
}

.logo-container-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.logo {
    max-width: 100px;
    height: auto;
}

.login-card h1 {
    text-align: center;
    font-size: 24px;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.login-card p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Checkbox */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    cursor: pointer;
}

/* History items */
.history-item {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
}

.history-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.history-icon.entry {
    background: var(--success-color);
}

.history-icon.exit {
    background: var(--danger-color);
}

.history-details {
    flex: 1;
}

.history-details h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.history-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

.history-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 767px) {
    .button-group {
        flex-direction: row;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
    }

    .navbar h1 {
        font-size: 18px;
    }

    .time-display {
        font-size: 40px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .icon-navigation {
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .nav-icon {
        min-width: 60px;
    }
    
    .nav-icon-symbol {
        font-size: 24px;
    }
    
    .nav-icon-label {
        font-size: 10px;
    }
}

@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 12px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: slideIn 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Section header */
.section-header {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

/* Material elevation */
.elevation-1 {
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.elevation-2 {
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.elevation-3 {
    box-shadow: 0 8px 16px rgba(0,0,0,0.16);
}

/* Password toggle */
.password-toggle {
    position: relative;
}

.password-toggle input {
    padding-right: 50px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
    font-size: 20px;
}

/* Ancien menu latéral supprimé */
.sidebar,
.menu-toggle {
    display: none !important;
}