/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Global Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --text-color: #333;
    --light-gray: #f5f6fa;
    --border-color: #dcdde1;
    --danger-color: #e74c3c;
    
    /* Font variables */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--light-gray);
    padding-top: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Adjust heading styles to use font weights */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.2;
}

/* Update navigation font styles */
.nav-brand a {
    font-family: var(--font-sans);
    font-weight: 600;
}

.nav-item a {
    font-family: var(--font-sans);
    font-weight: 500;
}

/* Update button font */
.btn-primary,
.btn-secondary,
.btn-danger {
    font-family: var(--font-sans);
    font-weight: 500;
}

/* Login Page Styles */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--light-gray);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    margin: 1rem;
}

.login-container h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group label {
    font-weight: bold;
    color: var(--primary-color);
}

.form-group input {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

button { cursor: pointer; }

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #1e2b38;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.error-message {
    background-color: #fde8e8;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

.success-message {
    background-color: #e8f8f0;
    color: var(--success-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

.form-links {
    margin-top: 1.5rem;
    text-align: center;
}

.form-links a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.form-links a:hover {
    color: var(--primary-color);
}

.separator {
    margin: 0 0.5rem;
    color: var(--border-color);
}

/* Portal Styles */
.portal-page {
    min-height: 100vh;
    background-color: var(--light-gray);
    padding: 0;
}

.portal-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.portal-header h1 {
    margin: 0;
    color: var(--primary-color);
}

.portal-nav {
    display: flex;
    gap: 1rem;
}

.portal-nav a {
    color: var(--secondary-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.portal-nav a:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* Feeds Page Styles */
.feeds-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.add-feed-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.add-feed-form {
    max-width: 600px;
    margin: 0 auto;
}

.feeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feed-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.feed-card:hover {
    transform: translateY(-2px);
}

.feed-preview {
    aspect-ratio: 16/9;
    background-color: #2c3e50;
    position: relative;
}

.feed-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.9rem;
}

.feed-info {
    padding: 1rem;
}

.feed-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.feed-status {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}

.feed-actions {
    display: flex;
    gap: 0.5rem;
}

.feed-actions button {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.no-feeds {
    text-align: center;
    color: #666;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ONVIF Test Page Styles */
.form-help {
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.stream-preview-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.stream-container {
    aspect-ratio: 16/9;
    background-color: #2c3e50;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.stream-container p {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border-radius: 4px;
    margin: 0;
    font-family: monospace;
    word-break: break-all;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-description {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

/* Update add-feed-section to accommodate the new header */
.add-feed-section h2 {
    margin-bottom: 1rem;
}

.add-feed-section .btn-secondary {
    padding: 0.5rem 1rem;
    text-decoration: none;
    font-size: 0.9rem;
}

/* URL Type Toggle Styles */
.url-type-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: var(--light-gray);
    border-radius: 4px;
}

.url-toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.url-toggle-btn.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.url-toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* Stream Info Styles */
.stream-info {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.stream-info h3 {
    color: white;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.stream-info p {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    margin: 0 0 1rem 0;
    border-radius: 4px;
    word-break: break-all;
}

.info-message {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Table Styles */
.table-container {
    @apply overflow-x-auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern th {
    background-color: #f8fafc;
    color: var(--primary-color);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table-modern td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: #4a5568;
}

.table-modern tr:hover td {
    background-color: #f8fafc;
}

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

/* Status Indicators */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge.online {
    background-color: #def7ec;
    color: #03543f;
}

.status-badge.offline {
    background-color: #fde8e8;
    color: #9b1c1c;
}

.status-dot {
    height: 0.5rem;
    width: 0.5rem;
    border-radius: 9999px;
    margin-right: 0.5rem;
}

.status-dot.online {
    background-color: #059669;
}

.status-dot.offline {
    background-color: #dc2626;
}

/* Action Buttons */
.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-preview:hover {
    background-color: #2563eb;
}

/* Modal Styles */
.modal-modern {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content-modern {
    background-color: #fefefe;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.preview-container {
    width: 80%;
    margin: 20px auto;
    padding: 20px;
    background: #000;
}

#camera-stream-container {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #000;
    margin: 10px 0;
}

#camera-stream {
    width: 100%;
    display: block;
}

.debug-info {
    height: 150px;
    overflow-y: auto;
    background: #f5f5f5;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid #ddd;
    margin-top: 10px;
}

.info {
    padding: 10px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 10px;
}

.modal-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    margin: 0;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.video-js {
    width: 100%;
    height: 0 !important;
    padding-top: 56.25% !important; /* 16:9 Aspect Ratio */
    position: relative;
}

.video-js .vjs-tech {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vjs-fluid {
    padding-top: 56.25%;
    width: 100%;
}

/* Preview Modal Specific Styles */
.modal-content-modern.preview-modal {
    max-width: 80%;
    height: fit-content;
    margin: 5vh auto;
    display: flex;
    flex-direction: column;
}

.modal-content-modern.preview-modal .modal-body {
    /*flex: 1;*/
    padding: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-content-modern.preview-modal .preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

/* Error Message in Video Container */
.preview-container .error-message {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 2;
    white-space: nowrap;
}

/* Flowplayer Styles */
.flowplayer-player {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #000;
    min-height: 0;
    flex: 1;
}

.flowplayer {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0;
    left: 0;
    border-radius: 4px;
}

.flowplayer.is-loading .fp-engine {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.flowplayer .fp-message {
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px;
    border-radius: 4px;
}

/* Modal Responsive Adjustments */
@media (max-height: 800px) {
    .modal-content-modern.preview-modal {
        height: 90vh;
        margin: 5vh auto;
    }
}

@media (max-height: 600px) {
    .modal-content-modern.preview-modal {
        height: 95vh;
        margin: 2.5vh auto;
    }
}

/* Navigation Menu Styles */
.main-nav {
    background-color: hsl(0 0% 100% / 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid hsl(240 5% 84%);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0;
    height: 4rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-brand a {
    color: hsl(240 6% 10%);
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: -0.025em;
}

.nav-brand a:hover {
    color: hsl(240 5% 34%);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
    align-items: center;
}

.nav-item a {
    color: hsl(240 4% 46%);
    text-decoration: none;
    font-size: 0.9375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item a:hover {
    color: hsl(240 6% 10%);
    background-color: hsl(240 5% 96%);
}

.nav-item.active a {
    color: hsl(240 6% 10%);
    background-color: hsl(240 5% 96%);
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }

    .nav-menu {
        position: fixed;
        top: 4rem;
        left: 0;
        right: 0;
        background-color: hsl(0 0% 100% / 0.9);
        backdrop-filter: blur(8px);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        border-bottom: 1px solid hsl(240 5% 84%);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-item a {
        display: block;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    /* Add hamburger menu button */
    .nav-toggle {
        display: block;
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        color: hsl(240 4% 46%);
    }

    .nav-toggle:hover {
        color: hsl(240 6% 10%);
    }
}

/* Hide hamburger menu on larger screens */
.nav-toggle {
    display: none;
}

/* Header Styles */
.main-header {
    background-color: hsl(0 0% 100% / 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid hsl(240 5% 84%);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 5rem;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-start {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.header-brand a {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(240 6% 10%);
    text-decoration: none;
    letter-spacing: -0.025em;
}

.header-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link,
.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem; /* Fixed height to ensure consistency */
    padding: 0 0.75rem;
    color: hsl(240 4% 46%);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.nav-link:hover,
.nav-dropdown-trigger:hover,
.nav-link.active {
    color: hsl(240 6% 10%);
    background-color: hsl(240 5% 96%);
}

.dropdown-arrow {
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.nav-item.active .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0.5rem);
    width: 24rem;
    background: white;
    border: 1px solid hsl(240 5% 84%);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
}

.nav-item.has-dropdown:hover .nav-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.nav-item.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Add a small delay before hiding dropdown when mouse leaves */
.nav-dropdown-content {
    transition-delay: 0s;
}

.nav-item.has-dropdown:hover .nav-dropdown-content {
    transition-delay: 0.1s;
}

.dropdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
}

.dropdown-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: hsl(240 6% 10%);
}

.dropdown-info p {
    margin: 0;
    font-size: 0.875rem;
    color: hsl(240 4% 46%);
    line-height: 1.5;
}

.dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    color: hsl(240 4% 46%);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.dropdown-link:hover {
    background-color: hsl(240 5% 96%);
    color: hsl(240 6% 10%);
}

.link-arrow {
    opacity: 0;
    transition: all 0.2s ease;
}

.dropdown-link:hover .link-arrow {
    opacity: 1;
}

.header-end {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    color: hsl(240 4% 46%);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .header-nav {
        display: none;
    }

    .header-nav.active {
        display: block;
        position: fixed;
        top: 5rem;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        border-bottom: 1px solid hsl(240 5% 84%);
        box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    }

    .nav-list {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-dropdown-content {
        position: static;
        width: 100%;
        transform: none;
        box-shadow: none;
        border: none;
        background: hsl(240 5% 96%);
        margin-top: 0.5rem;
    }

    .nav-item.active .nav-dropdown-content {
        transform: none;
    }

    .dropdown-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .mobile-menu-toggle {
        display: block;
    }
}

.header-end .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    padding: 0 1rem;
    background: transparent;
    border: 1px solid hsl(240 5% 84%);
    color: hsl(240 4% 46%);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.header-end .btn-outline:hover {
    background-color: hsl(240 5% 96%);
    border-color: hsl(240 5% 65%);
    color: hsl(240 6% 10%);
}

.header-end .btn-outline:active {
    background-color: hsl(240 5% 90%);
    transform: translateY(1px);
}

/* User Avatar Styles */
.user-avatar {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background-color: hsl(240 5% 96%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(240 4% 46%);
    border: 1px solid hsl(240 5% 84%);
    transition: all 0.2s ease;
}

.user-avatar:hover {
    background-color: hsl(240 5% 90%);
    border-color: hsl(240 5% 65%);
}

.user-avatar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 12rem;
    background: white;
    border: 1px solid hsl(240 5% 84%);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: all 0.2s ease;
    pointer-events: none;
}

.user-avatar:hover .user-avatar-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.avatar-menu-items {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
}

.avatar-menu-item {
    margin: 0;
    padding: 0;
}

.avatar-menu-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: hsl(240 4% 46%);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

.avatar-menu-link:hover {
    background-color: hsl(240 5% 96%);
    color: hsl(240 6% 10%);
}

.avatar-menu-link svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Captures Page Styles */
.captures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.capture-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.capture-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.capture-info {
    padding: 1.5rem;
}

.capture-info h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.capture-details {
    margin-bottom: 1.5rem;
}

.capture-details p {
    margin: 0.5rem 0;
    color: hsl(240 4% 46%);
    font-size: 0.9375rem;
}

.capture-details strong {
    color: hsl(240 6% 10%);
}

.capture-actions {
    display: flex;
    gap: 0.75rem;
}

.capture-actions button {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
}

.no-captures {
    text-align: center;
    padding: 3rem 1.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: hsl(240 4% 46%);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h1 {
    margin: 0;
    color: var(--primary-color);
}

/* Form Styles */
.form-modern {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

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

.form-group label {
    font-weight: 500;
    color: hsl(240 6% 10%);
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid hsl(240 5% 84%);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    color: hsl(240 6% 10%);
    background-color: white;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input:hover,
.form-group select:hover {
    border-color: hsl(240 5% 65%);
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: hsl(0 0% 98%);
    border-top: 1px solid hsl(240 5% 94%);
}

.modal-footer button {
    min-width: 100px;
    padding: 0.75rem 1.5rem;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .captures-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }

    .capture-actions {
        flex-direction: column;
    }
}

/* Overlays Grid */
.overlays-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.overlay-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.overlay-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.overlay-preview {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.overlay-info {
    padding: 1rem;
}

.overlay-info h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    color: #1a1a1a;
}

.overlay-description {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: #666;
    line-height: 1.4;
}

.overlay-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.no-overlays {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 0.75rem;
    margin-top: 1.5rem;
}

/* File Upload Styles */
input[type="file"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    background: white;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #666;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .overlays-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .overlay-actions {
        flex-direction: column;
    }
} 