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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    color: #333;
}

/* Navbar Styles */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.navbar-brand:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.navbar-logo {
    font-size: 2rem;
}

.navbar-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.navbar-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.navbar-link:hover {
    background-color: #f0f0f0;
    color: #667eea;
}

.navbar-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.navbar-link svg {
    vertical-align: middle;
}

.arxiv-link {
    padding: 0.25rem 0.5rem;
}

.arxiv-logo {
    height: 24px;
    width: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.gallery-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.gallery-section h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.8rem;
    text-align: center;
}

.sketch-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.sketch-section h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.8rem;
}

.canvas-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#sketchCanvas {
    border: 3px solid #667eea;
    border-radius: 10px;
    cursor: crosshair;
    background: white;
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    touch-action: none; /* Prevents scrolling while drawing */
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.disclaimer-text {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 15px;
    font-style: italic;
}

.btn {
    padding: 12px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #667eea;
    font-size: 1.2rem;
    font-weight: 500;
}

.results-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.results-section h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.8rem;
    text-align: center;
}

.pagination-info {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 1rem;
    font-weight: 500;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 10px;
    margin-bottom: 30px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: #764ba2;
    transform: translateY(-2px);
}

.page-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.page-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.page-number {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
}

.page-number:hover {
    background: #f0f0f0;
}

.page-number.active {
    background: #667eea;
    color: white;
}

.page-ellipsis {
    padding: 8px;
    color: #666;
    font-weight: 600;
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    padding: 8px 15px;
    background: #f8f8f8;
    border-radius: 8px;
}

.page-jump label {
    font-weight: 600;
    color: #667eea;
    white-space: nowrap;
}

.page-jump input {
    width: 60px;
    padding: 6px 10px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
}

.page-jump input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.page-jump-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: #667eea;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-jump-btn:hover {
    background: #764ba2;
    transform: translateY(-1px);
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f5f5f5;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rank {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Image Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
}

#modalCaption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 40px;
    font-size: 16px;
}

.gallery img {
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery img:hover {
    transform: scale(1.05);
}

/* Centered Heading */
.centered-heading {
    text-align: center;
}

/* About Page Styles */
.about-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.about-section h2 {
    color: #667eea;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 30px;
}

.about-content h3 {
    color: #667eea;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.about-content p {
    line-height: 1.6;
    color: #666;
    margin-bottom: 1rem;
}

.about-content .intro-text {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 2rem;
}

.about-content ul {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.about-content li {
    margin-bottom: 0.5rem;
    color: #666;
    line-height: 1.6;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin: 2rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Model Image */
.model-image {
    margin: 2rem 0;
    text-align: center;
}

.model-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.image-caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

/* Results Table */
.results-table {
    margin: 2rem 0;
    overflow-x: auto;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.results-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.results-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.results-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    color: #666;
}

.results-table tbody tr:hover {
    background-color: #f9f9f9;
}

.results-table tr.highlight {
    background-color: #fff3f0;
}

.results-table tr.highlight td {
    color: #667eea;
    font-weight: 600;
}

.table-caption {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

.back-link {
    margin-top: 2rem;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .sketch-section,
    .results-section,
    .gallery-section {
        padding: 20px;
    }
    
    #sketchCanvas {
        width: 100%;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .pagination {
        flex-direction: column;
    }
    
    .page-jump {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .navbar-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .navbar-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-logo {
        font-size: 1.5rem;
    }
    
    .about-section {
        padding: 20px;
    }
    
    .about-content h3 {
        font-size: 1.2rem;
    }
    
    .results-table {
        font-size: 0.9rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .page-jump {
        flex-wrap: wrap;
        justify-content: center;
    }
}
