* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --secondary: #34a853;
    --surface: #ffffff;
    --background: #f8faff;
    --on-surface: #202124;
    --on-surface-variant: #5f6368;
    --outline: #dadce0;
    --shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --shadow-lg: 0 2px 6px 2px rgba(60, 64, 67, 0.15), 0 8px 24px 4px rgba(60, 64, 67, 0.15);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8faff 0%, #e8f0fe 100%);
    color: var(--on-surface);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header Styling */
.header-section {
    background: var(--surface);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-img {
    max-height: 80px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(60, 64, 67, 0.15));
    transition: var(--transition);
}

.header-img:hover {
    transform: scale(1.05);
}

/* Main Container */
.center {
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Title Styling */
.main-title {
    color: var(--on-surface);
    font-size: 2.5rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

.main-title strong {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 500;
}

/* Grid Layout */
.new_container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
}

/* Card Styling */
.left-content, .right-content {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    border: 1px solid var(--outline);
    transition: var(--transition);
}

.left-content:hover, .right-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 4px rgba(60, 64, 67, 0.15), 0 16px 32px 8px rgba(60, 64, 67, 0.15);
}

/* Section Headers */
.section-title {
    color: var(--on-surface);
    font-size: 1.5rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 2px;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.25rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--outline);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--surface);
    transition: var(--transition);
    outline: none;
}

.form-control::placeholder {
    color: var(--on-surface-variant);
    font-weight: 400;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

.form-control:hover:not(:focus) {
    border-color: var(--on-surface);
}

.form-control:invalid:not(:placeholder-shown) {
    border-color: #ea4335;
}

.form-control:valid:not(:placeholder-shown) {
    border-color: var(--secondary);
}

/* Button Styling */
.btn-primary, .btn-secondary, .btn-outline-light {
    border: none;
    border-radius: var(--border-radius);
    color: white;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
}

.btn-primary::before, .btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before, .btn-secondary:hover::before {
    left: 100%;
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px 0 rgba(60, 64, 67, 0.3), 0 8px 16px 4px rgba(60, 64, 67, 0.15);
}

.btn-primary:active, .btn-secondary:active {
    transform: translateY(0);
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Prediction Results */
.prediction-container {
    text-align: center;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.prediction-result {
    background: linear-gradient(135deg, var(--secondary) 0%, #2d7d32 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.prediction-result::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.prediction-label {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.prediction-value {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    margin: 0.75rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.prediction-unit {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 0.5rem;
}

.empty-state {
    color: var(--on-surface-variant);
    text-align: center;
    padding: 2rem 1rem;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.6;
}

.empty-state-text {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Feedback Section */
.feedback-section {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--outline);
}

.feedback-section textarea {
    border: 2px solid var(--outline);
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: var(--transition);
    resize: vertical;
    min-height: 100px;
    width: 100%;
}

.feedback-section textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

/* Upload Section */
.upload-section {
    margin: 2rem auto;
    max-width: 1400px;
    padding: 0 1rem;
}

.upload-card {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    text-align: center;
}

.upload-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.upload-subtitle {
    font-size: 0.9rem;
    color: var(--on-surface-variant);
    margin-bottom: 1rem;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: var(--surface);
    margin: 5% auto;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 90%;
    width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h4 {
    font-size: 1.25rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--on-surface-variant);
}

.modal-body {
    font-size: 0.9rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading States */
.btn-primary:disabled {
    background: var(--outline);
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled::before {
    display: none;
}

/* Responsive Design */
@media (max-width: 992px) {
    .new_container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .left-content, .right-content {
        padding: 1rem;
    }
    
    .left-content + .right-content {
        border-left: none;
    }
}

@media (max-width: 768px) {
    .header-section {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-img {
        max-height: 60px;
    }
    
    .main-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .prediction-value {
        font-size: 2rem;
    }
    
    .center {
        padding: 0 0.75rem;
    }
    
    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
}

@media (max-width: 576px) {
    .left-content, .right-content {
        padding: 0.75rem;
    }
    
    .main-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .prediction-value {
        font-size: 1.5rem;
    }
    
    .form-control {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .btn-primary, .btn-secondary {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    .btn-lg {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    .upload-title {
        font-size: 1rem;
    }
    
    .upload-subtitle {
        font-size: 0.8rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .modal-header h4 {
        font-size: 1rem;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Indicators */
.btn-primary:focus-visible, .btn-secondary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.form-control:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}