@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --primary: #B9904C;
    /* Gold Accent */
    --primary-hover: #9e7a41;
    --secondary: #002554;
    /* Navy Blue */
    --accent: #f43f5e;
    --background: #002554;
    --surface: #0a1c36;
    --surface-glass: rgba(10, 28, 54, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --secondary: #4f46e5;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

button {
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
}

aside {
    padding: 2rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

main {
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.nav-link.active,
.nav-link:hover {
    background: var(--border);
    color: var(--text-main);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(14, 165, 233, 0.1);
}

/* Dashboard Grid & List */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.vessel-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1fr;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    animation: fadeIn 0.4s ease-out;
}

.vessel-row:hover {
    background: var(--border);
    transform: translateX(4px);
}

.card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    animation: fadeIn 0.5s ease-out;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    aside {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 950;
        transition: var(--transition);
        background: var(--surface);
        /* Solid background on mobile */
    }

    aside.active {
        left: 0;
    }

    main {
        padding: 5rem 1.5rem 1.5rem 1.5rem;
    }

    #mobile-menu-btn {
        display: block !important;
    }

    .vessel-row {
        grid-template-columns: 1fr auto;
        gap: 1rem;
        padding: 1.5rem;
        height: auto;
    }

    .vessel-row>div:nth-child(2) {
        order: 3;
        grid-column: 1 / span 2;
    }

    .vessel-row>div:nth-child(3) {
        order: 2;
        text-align: right;
    }

    .vessel-row>div:nth-child(4) {
        order: 4;
        grid-column: 1 / span 2;
        text-align: left !important;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .btn-primary {
        width: 100%;
        text-align: center;
    }

    .vessel-row {
        padding: 1.25rem;
    }

    .card {
        padding: 1.25rem;
    }

    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.1rem;
    }
}

/* Checklist & UI Utilities */
.checklist-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.observation-camp {
    width: 100%;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 0.75rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.photo-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.02);
}

.photo-upload-area:hover {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.05);
}

.status-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-ok {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.status-warning {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.status-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    color: var(--text-main);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    transition: bottom 0.3s ease-in-out;
}

.toast.show {
    bottom: 2rem;
}

/* Timeline */
.timeline {
    position: relative;
    margin-top: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 4rem;
    margin-bottom: 2rem;
}

.timeline-dot {
    position: absolute;
    left: 1.15rem;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--background);
    z-index: 1;
}

/* Collapsible Sections */
.schedule-category {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.schedule-category summary {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
    user-select: none;
}

.schedule-category[open] summary {
    border-bottom-color: var(--border);
}

.schedule-category summary::-webkit-details-marker {
    display: none;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-count {
    font-size: 0.75rem;
    background: var(--border);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    color: var(--text-muted);
}

.chevron {
    transition: var(--transition);
    opacity: 0.5;
}

.schedule-category[open] .chevron {
    transform: rotate(180deg);
}

/* Category Colors */
.cat-past-due {
    border-left: 4px solid #ef4444;
}

.cat-due {
    border-left: 4px solid var(--primary);
}

.cat-programmed {
    border-left: 4px solid #38bdf8;
}

.cat-past-due summary {
    color: #fca5a5;
}

.cat-due summary {
    color: var(--text-main);
}

.cat-programmed summary {
    color: #7dd3fc;
}