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

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0 !important; /* 🔁 Sharp corners globally */
}

body {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #ff6a00 0%, #ee0979 100%);

    min-height: 100vh;
}

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

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

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

.logo i {
    font-size: 2rem;
    color: #4CAF50;
}

.logo h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 0;
}

.tagline {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-left: 8px;
}

.nav {
    display: flex;
    gap: 30px;
    
}

.nav-link {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background: #4CAF50;
    color: white;
    transform: translateY(-2px);
}

/* Main Content */
.main {
    min-height: calc(100vh - 80px);
}

/* Hero Section */
.hero {
    padding: 60px 0;
    text-align: center;
    color: white;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Upload Form */
.upload-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 110px;
    margin: 0 auto;
    max-width: 900px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.upload-area {
    border: 3px dashed #4CAF50;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.upload-area:hover {
    border-color: #45a049;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-2px);
}

.upload-area.drag-over {
    border-color: #45a049;
    background: rgba(76, 175, 80, 0.1);
}

.upload-area.has-files {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.upload-icon i {
    font-size: 3rem;
    color: #4CAF50;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.upload-area p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.file-input {
    display: none;
}

.file-types {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Image Preview */
.image-preview {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.preview-item {
    background: white;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    margin: 10px; /* 🔁 Added spacing between preview cards */
}

.preview-item:hover {
    transform: translateY(-5px);
}

.preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    margin-bottom: 8px;
}

.preview-info {
    text-align: center;
}

.file-name {
    display: block;
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Analyze Button */
.analyze-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    min-width: 200px;
}

/* How It Works Section */
.how-it-works {
    padding: 80px 40px; /* 🔁 Extra horizontal padding */
    background: rgba(255, 255, 255, 0.95);
    margin: 60px 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 50px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.step {
    text-align: center;
    padding: 30px;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    margin: 10px; /* 🔁 Extra spacing */
}

.step-icon i {
    font-size: 3rem;
    color: #4CAF50;
    margin-bottom: 20px;
}

/* Results Section */
.results {
    padding: 60px 40px; /* 🔁 Extra horizontal padding */
    background: rgba(255, 255, 255, 0.95);
    margin: 60px 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.results h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 40px;
}

.results h2 i {
    margin-right: 15px;
    color: #4CAF50;
}

/* Results Summary */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: white;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
    margin: 10px; /* 🔁 Add spacing */
}

.summary-icon i {
    font-size: 3rem;
    color: #4CAF50;
    margin-bottom: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.result-card {
    background: white;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    margin: 10px; /* 🔁 Added spacing between result cards */
}

.result-icon i {
    font-size: 3rem;
    color: #4CAF50;
    margin-bottom: 20px;
}
.result-card:hover {
    transform: translateY(-5px);
}

.result-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.confidence-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.result-content {
    padding: 25px;
}

.disease-name {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.disease-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    width: fit-content;
}

.disease-status.healthy {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.disease-status.disease {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

.diagnosis {
    margin-bottom: 20px;
}

.diagnosis h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.diagnosis p {
    color: #7f8c8d;
    line-height: 1.6;
}

.timestamp {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Download Section */
.download-section {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #2196F3 0%, #21CBF3 100%);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: linear-gradient(135deg, #1976D2 0%, #2196F3 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.4);
}

/* Footer */
.footer {
    background: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #4CAF50;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #4CAF50;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(59, 219, 64, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: none;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

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

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

.loading-content h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.loading-content p {
    color: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .upload-form {
        margin: 0 10px;
        padding: 20px;
    }
    
    .nav {
        gap: 15px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .results-summary {
        grid-template-columns: 1fr;
    }
    
    .image-preview {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .upload-area {
        padding: 20px;
    }
    
    .upload-icon i {
        font-size: 2rem;
    }
    
    .upload-area h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .upload-form {
        padding: 15px;
    }
    
    .step {
        padding: 20px;
    }
    
    .result-card {
        margin: 0 10px;
    }
    
    .summary-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .summary-content h3 {
        font-size: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Accessibility Improvements */
.upload-area:focus-within {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.analyze-btn:focus,
.download-btn:focus,
.nav-link:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .upload-area {
        border-width: 4px;
    }
    
    .disease-status.healthy {
        background: #4CAF50;
        color: white;
    }
    
    .disease-status.disease {
        background: #FF9800;
        color: white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner {
        animation: none;
        border: 4px solid #4CAF50;
    }
}
