/* Core variables and theme */
:root {
    --primary-color: #2563eb;    /* Vibrant blue */
    --primary-dark: #1d4ed8;     /* Darker blue */
    --primary-light: #3b82f6;    /* Lighter blue */
    --primary-lightest: #dbeafe; /* Very light blue for backgrounds */
    --secondary-color: #64748b;  /* Neutral slate */
    --background: #f8fafc;       /* Light gray background */
    --panel-bg: #ffffff;         /* White panels */
    --text-primary: #1e293b;     /* Dark slate for text */
    --text-secondary: #475569;   /* Medium slate for secondary text */
    --border-color: #e2e8f0;     /* Light border */
    --success-color: #2563eb;    /* Using primary blue instead of green */
    --error-color: #dc2626;      /* Keep red for errors */
    --nav-height: 70px;
}
/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--background);
    line-height: 1.5;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    height: var(--nav-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: 40px;
    border-radius: 8px;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: var(--panel-bg);
    font-weight: 600;
}

/* Main Content Layout */
.main-content {
    flex: 1;
    padding: calc(var(--nav-height) + 24px) 24px 24px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 24px;
}

/* Panels */
.panel {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgb(37 99 235 / 0.05), 
                0 2px 4px -2px rgb(37 99 235 / 0.05);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary-color) 50%, 
        transparent 100%);
    opacity: 0.5;
}

/* Form Controls */
.input-row {
    margin-bottom: 20px;
}

.input-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: var(--primary-color);
}

input[type="number"] {
    width: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
    margin-right: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 255, 140, 0.2);
}

/* Buttons */
button {
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 140, 0.2);
}

button:active {
    transform: translateY(0);
}

.analyze-btn {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    background: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.analyze-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.analyze-btn:not(:disabled):hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 255, 140, 0.2);
}

/* Video Container */
.video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

video {
    width: 100%;
    display: block;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* Graphs Section */
.graphs-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.graph-container {
    flex: 1;
    min-height: 200px;
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    position: relative;
}

.graph-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, 
        transparent 0%, 
        rgba(0, 255, 140, 0.1) 50%, 
        transparent 100%);
    border-radius: 12px;
    z-index: -1;
    opacity: 0.5;
}

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

.stats-table th,
.stats-table td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.stats-table th {
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(0, 255, 140, 0.05);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 13px;
}

.stats-table tr:hover td {
    background: rgba(0, 255, 140, 0.05);
}

/* Footer */
.footer {
    background: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    padding: 48px 24px 24px;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
}

.footer-section h3 {
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 300px;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: block;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-color);
    color: var(--panel-bg);
    transform: translateY(-2px);
}

.footer-bottom {
    max-width: 1400px;
    margin: 24px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Focus States */
input:focus, button:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Loading and Error States */
#loading {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 11, 14, 0.9);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: var(--primary-color);
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#loading.visible {
    display: flex;
}

#error {
    display: none;
    padding: 16px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid var(--error-color);
    color: #ef4444;
    border-radius: 8px;
    margin: 12px 0;
}

#error.visible {
    display: block;
}

/* Setup Section Headers */
.setup-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

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

#loading {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 11, 14, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.loading-content {
    text-align: center;
}

.loading-text {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.progress-bar {
    width: 300px;
    height: 4px;
    background: rgba(37, 99, 235, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    animation: progress 2s ease-in-out infinite;
}

/* Ad placeholder styles */
.ad-placeholder {
    width: 720px;
    height: 480px;
    background: rgba(37, 99, 235, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-content {
    text-align: center;
    color: var(--primary-color);
}

.ad-text {
    display: block;
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.ad-size {
    display: block;
    font-size: 1rem;
    opacity: 0.7;
}

@keyframes progress {
    0% {
        width: 0%;
        opacity: 1;
    }
    50% {
        width: 100%;
        opacity: 0.5;
    }
    100% {
        width: 0%;
        opacity: 1;
    }
}

.logo-img {
    height: 40px;
    width: 40px;
    object-fit: contain;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Add these media queries and modifications to your existing CSS */

/* Base responsive adjustments */
:root {
    --container-padding: 24px;
    --mobile-nav-height: 60px;
}

@media (max-width: 768px) {
    :root {
        --container-padding: 16px;
    }
    
    body {
        font-size: 14px;
    }

    .main-content {
        padding: calc(var(--mobile-nav-height) + 16px) 16px 16px;
    }
}

/* Responsive container layout */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 800px;
    }
}

/* Navigation responsive styles */
@media (max-width: 768px) {
    .navbar {
        height: var(--mobile-nav-height);
    }

    .nav-content {
        padding: 0 16px;
    }

    .logo-text {
        font-size: 18px;
    }

    .logo-img {
        height: 32px;
        width: 32px;
    }

    .nav-button {
        padding: 8px 16px;
        font-size: 14px;
    }

    .nav-button svg {
        width: 16px;
        height: 16px;
    }
}

/* Form controls responsive styles */
@media (max-width: 768px) {
    .input-row {
        margin-bottom: 16px;
    }

    .input-row label {
        font-size: 12px;
    }

    input[type="number"] {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }

    .analyze-btn {
        padding: 12px;
        font-size: 14px;
    }
}

/* Video container responsive styles */
@media (max-width: 768px) {
    .video-container {
        margin: 12px 0;
    }
}

/* Stats table responsive styles */
@media (max-width: 768px) {
    .stats-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .stats-table th,
    .stats-table td {
        padding: 12px;
        font-size: 12px;
    }
}

/* Footer responsive styles */
@media (max-width: 768px) {
    .footer {
        padding: 32px 16px 16px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-section h3 {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .footer-section p,
    .footer-section a {
        font-size: 12px;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        margin-top: 16px;
        padding-top: 16px;
        font-size: 12px;
    }
}

/* Loading overlay responsive styles */
@media (max-width: 768px) {
    .loading-container {
        padding: 16px;
    }

    .loading-text {
        font-size: 1rem;
    }

    .progress-bar {
        width: 200px;
    }

    .ad-placeholder {
        width: 100%;
        height: 240px;
    }

    .ad-text {
        font-size: 1.25rem;
    }
}

/* Usability improvements */
.input-row {
    position: relative;
}

.input-row label::after {
    content: attr(data-unit);
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 12px;
}

.analyze-btn {
    position: relative;
    padding-left: 40px;
}

.analyze-btn::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Tooltip styles for better UX */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px;
    background: var(--text-primary);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}