:root {
    --primary-color: #3a86ff;
    --secondary-color: #4361ee;
    --accent-color: #ff006e;
    --good-color: #38b000;
    --defect-color: #ff006e;
    --light-bg: #f8f9fd;
    --dark-text: #2b2d42;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 14px 28px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Header Styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    background: white;
    box-shadow: var(--card-shadow);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    height: 70px;
}
 
.navbar-logo {
    font-size: 1.5em;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-decoration: none;
}
 
.navbar ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 20px;
}
 
.navbar li a {
    color: var(--dark-text);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    transition: color 0.3s ease;
}
 
.navbar li a:hover {
    color: #6a11cb;
}
 
.signup-btn {
    background: var(--secondary-color);
    color: white !important;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease;
}
 
.signup-btn:hover {
    transform: translateY(-3px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 6rem 1rem 4rem;
    margin-bottom: 2rem;
    background-image: url('/assets/images/voice wave.gif');
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: #555;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

/* Main Container Layout */
.container {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 100px auto 50px;
    padding: 0 20px;
}

/* Common styles for both containers */
.sample-gallery,
.classification-container {
    flex: 1;
    min-width: 0;
    background-color: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

/* Sample Gallery styling */
.sample-gallery:hover,
.classification-container:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-5px);
}

.sample-gallery h2 {
    font-size: 1.5rem;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sample-gallery h2 i {
    color: var(--primary-color);
}

.sample-gallery p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.gallery-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.gallery-tab {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-tab i {
    font-size: 0.9rem;
}

.gallery-tab.active {
    background-color: rgba(58, 134, 255, 0.1);
    color: var(--primary-color);
}

.gallery-tab:not(.active):hover {
    background-color: #f8f9fa;
}

.gallery-tab:first-child i {
    color: var(--good-color);
}

.gallery-tab:last-child i {
    color: var(--defect-color);
}

.gallery-container {
    position: relative;
    min-height: 220px;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

/* Classification Container */
.classification-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Upload Container */
.upload-container {
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: none;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.input-header h2 {
    font-size: 1.5rem;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-header h2 i {
    color: var(--primary-color);
}

.input-actions {
    display: flex;
    gap: 0.8rem;
}

.btn-clear, .-sample {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background-color: #f1f3f5;
    border: none;
    color: var(--dark-text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-clear:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.btn-clear i {
    color: var(--defect-color);
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(58, 134, 255, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

.upload-text {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.upload-subtext {
    font-size: 0.9rem;
    color: #adb5bd;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.img-stats {
    font-size: 0.9rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.img-stats i {
    color: var(--primary-color);
}

.btn-classify {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-classify:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-classify:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-classify:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result Container */
.result-wrapper {
    box-shadow: none;
    padding: 0;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.result-header h2 {
    font-size: 1.5rem;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-header h2 i {
    color: var(--accent-color);
}

.result-actions {
    display: flex;
    gap: 0.8rem;
}

.btn-copy, .btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    background: #f5f5f5;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #333;
    font-weight: 500;
    gap: 0.5rem;
}

.btn-copy i, .btn-download i {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.btn-copy:hover, .btn-download:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.btn-copy:hover i, .btn-download:hover i {
    transform: scale(1.2);
    color: var(--primary-color);
}

.btn-copy:active, .btn-download:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.classification-result {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-content {
    width: 100%;
    text-align: center;
    padding: 2rem;
}

.result-img-container {
    width: 100%;
    max-height: 250px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.result-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.classification-badge {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease-in-out;
}

.good-badge {
    background-color: rgba(56, 176, 0, 0.1);
    color: var(--good-color);
    border: 2px solid var(--good-color);
}

.defect-badge {
    background-color: rgba(255, 0, 110, 0.1);
    color: var(--defect-color);
    border: 2px solid var(--defect-color);
}

.confidence-meter {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    background-color: #f1f3f5;
    border-radius: 50px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.confidence-fill {
    height: 100%;
    border-radius: 50px;
    transition: width 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.confidence-good {
    background-color: var(--good-color);
}

.confidence-defect {
    background-color: var(--defect-color);
}

.confidence-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Details List */
.details-list {
    margin-top: 1.5rem;
    text-align: left;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 1.2rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-label i {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.detail-value {
    font-weight: 600;
    color: var(--dark-text);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.loading-overlay.active {
    opacity: 1;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    background-color: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    max-width: 90%;
    width: 500px;
}

.ai-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.loading-spinner-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
}

.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(58, 134, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-progress {
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.loading-subtext {
    font-size: 1rem;
    color: #6c757d;
}

/* Notification toast */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* File input hidden */
#imageInput {
    display: none;
}

/* Preview Image */
.preview-image {
    max-width: 100%;
    max-height: 250px;
    display: block;
    margin: 1rem auto;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
        padding: 1rem;
        margin-top: 80px;
    }
    
    .sample-gallery, 
    .classification-container {
        width: 100%;
    }
    
    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        height: auto;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }

    
    .input-header, .result-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .input-actions, .result-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .input-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-classify {
        width: 100%;
        justify-content: center;
    }
    
    .classification-badge {
        font-size: 1.2rem;
        padding: 0.8rem 1.5rem;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0.5rem;
        margin-top: 120px;
    }
    
    .sample-gallery, 
    .classification-container {
        padding: 1rem;
    }
    
    .gallery-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
}