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

:root {
    --primary: #4a90e2;
    --secondary: #357abd;
    --accent: #5ba3f5;
    --bg-primary: #0a0e1a;
    --bg-secondary: #12182b;
    --bg-card: #1a2234;
    --text-primary: #e8edf5;
    --text-secondary: #a0aec0;
    --border-color: #2d3748;
    --success: #4ade80;
    --warning: #fbbf24;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 80px;
}

/* ==================== HEADER ==================== */
.header {
    background: var(--bg-secondary);
    padding: 1.5rem;
    padding-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header.admin h1 {
    background: linear-gradient(135deg, rgba(245, 158, 11), rgb(203, 132, 9));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

div.header img {
    height: 70px;
    width: auto;
    border-radius: 12px;
}

div.header div.title {
    display: inline-block;
}

.calendar-action-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.calendar-info h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
}

.calendar-date,
.calendar-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.calendar-date .icon,
.calendar-location .icon {
    width: 16px;
    height: 16px;
    stroke: var(--primary);
}

.calendar-button-wrapper {
    position: relative;
    flex-shrink: 0;
}

.calendar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.calendar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.calendar-btn:active {
    transform: translateY(0);
}

.calendar-btn .icon {
    width: 20px;
    height: 20px;
    stroke: white;
}

.calendar-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.calendar-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.calendar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.calendar-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.calendar-dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.calendar-dropdown-item:hover {
    background: var(--bg-secondary);
}

.calendar-dropdown-item .icon {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
    flex-shrink: 0;
}

.calendar-dropdown-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.calendar-dropdown-item small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Animation du menu */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-dropdown-menu.show {
    animation: slideDown 0.3s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .calendar-btn {
        width: 100%;
        justify-content: center;
    }
    
    .calendar-dropdown-menu {
        left: 0;
        right: 0;
        min-width: auto;
    }
}


/* ==================== NAVIGATION ==================== */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 99;
    backdrop-filter: blur(10px);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}


.nav-item.red {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.nav-item.red:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.nav-item.admin {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.nav-item.admin:hover {
    background: rgba(158, 107, 19, 0.6);
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 4px 15px rgba(145, 94, 6, 0.2);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.nav-item.admin.active {
    background: rgba(158, 107, 19, 0.9);
    border-color: rgba(245, 158, 11, 0.9);
    box-shadow: 0 4px 15px rgba(145, 94, 6, 0.2);
}

.nav-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.nav-label {
    display: inline;
}

/* ==================== RESPONSIVE NAVIGATION ==================== */
@media (max-width: 768px) {
    body {
        padding-top: 0;
        padding-bottom: 90px;
    }

    .header {
        position: relative;
        top: 0;
    }

    .navbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        justify-content: space-around;
        padding: 0.5rem;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        border-bottom: none;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
        z-index: 999;
    }

    .nav-item {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem 0.75rem;
        flex: 1;
        max-width: 100px;
        text-align: center;
    }

    .nav-label {
        font-size: 0.75rem;
    }

    .nav-icon {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .nav-item {
        padding: 0.4rem 0.5rem;
    }

    .nav-label {
        font-size: 0.7rem;
    }
}

/* ==================== CONTAINER ==================== */
.container {
    margin: 0 auto;
    padding: 1.5rem;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
    stroke-width: 2;
    fill: none;
}

.location-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.location-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==================== LOGIN OVERLAY ==================== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .72);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    max-height: calc(100vh - 40px);
    overflow: auto;
}

.login-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.switch-btn {
    border: 0;
    background: transparent;
    color: #386de1;
    font-weight: 700;
    cursor: pointer;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.login-field input {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
}

.login-btn {
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    background: #386de1;
    color: #fff;
}

.login-error {
    margin-top: 10px;
    color: #b91c1c;
    font-size: 14px;
    min-height: 18px;
}

.hidden {
    display: none;
}

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

.location-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.location-detected {
    color: var(--success);
    font-weight: 500;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

div.login-overlay label {
    display: block;
    color: var(--bg-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

div.login-overlay h2 {
    color: var(--bg-primary);
}

.form-select,
.form-input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
    appearance: none;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234a90e2' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
    padding-right: 3rem;
}

.form-input[type="time"] {
    font-family: inherit;
}

input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* ==================== RIPPLE EFFECT ==================== */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==================== BUTTONS ==================== */
a.btn-primary,
a.btn-secondary,
.btn-primary,
.btn-secondary {
    display: block;
    width: 100%;
    padding: 0.4rem;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-sizing: border-box;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
}

a.btn-primary,
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

a.btn-secondary,
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

a.btn-secondary.red,
.btn-secondary.red {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

a.btn-secondary.red:hover,
.btn-secondary.red:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-secondary.admin {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-secondary.admin:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
}

.btn-details {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}

a.btn-primary:hover,
.btn-primary:hover,
.btn-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

a.btn-secondary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--bg-card);
}

a.btn-primary:active,
a.btn-secondary:active,
.btn-primary:active,
.btn-secondary:active {
    transform: translateY(0);
}

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

/* ==================== BADGES & MESSAGES ==================== */
.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 20px;
    color: var(--accent);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.distance-badge {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
    color: var(--success);
}

.error-message {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #f87171;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ==================== TRIPS HEADER ==================== */
.trips-header {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ==================== BUTTON STACKS ==================== */
.card .btn-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.center{
  display: grid;
  place-items: center;
  width: 100%;
}

.card .btn-stack > a,
.card .btn-stack > button {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-decoration: none;
}

input[type="radio"][name="has_material"]:checked + span {
    color: var(--primary);
}

input[type="radio"][name="has_material"]:checked {
    accent-color: var(--primary);
}

label:has(input[type="radio"][name="has_material"]:checked) {
    border-color: var(--primary);
    background: rgba(74, 144, 226, 0.1);
}

@media (min-width: 520px) {
    .card .btn-stack {
        flex-direction: row;
    }
    
    .card .btn-stack > a,
    .card .btn-stack > button {
        flex: 1;
        width: auto;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (min-width: 768px) {
    .container,
    .trips-header {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .login-overlay {
        align-items: flex-start;
    }

    .login-card {
        margin-top: 10px;
    }

    .header {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .card {
        padding: 1.2rem;
    }
    
    a.btn-primary,
    a.btn-secondary,
    .btn-primary,
    .btn-secondary {
        margin-bottom: 1rem;
    }
}

@media (max-width: 769px) {

    .nav-label {
        display: none;
    }

    .hidden-on-mobile {
        display: none;
    }

    .nav-item.red {
        padding: 0.625rem;
        justify-content: center;
    }

    .nav-item.admin .nav-icon,
    .nav-item.red .nav-icon {
        width: 22px;
        height: 22px;
    }
}