/* CSS Custom Properties */
:root {
    --primary-color: #0066cc;
    --primary-dark: #004499;
    --secondary-color: #00cc66;
    --accent-color: #ff6b35;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --background: #ffffff;
    --surface: #f8f9fa;
    --border: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background);
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 0;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.1;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

.privacy-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.privacy-icon {
    font-size: 1.2rem;
}

.privacy-text {
    font-size: 0.9rem;
    font-weight: 500;
}



/* Hero Section - Dashboard Style */
.dashboard-hero {
    background: linear-gradient(135deg, #ff7722 0%, #007bff 100%) !important;
    color: white !important;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.dashboard-title {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    color: white !important;
}

.dashboard-subtitle {
    font-size: 1.1rem !important;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    color: white !important;
}

.dashboard-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255,255,255,0.2);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    text-align: center;
    min-width: 120px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
    color: white;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    color: white;
}

/* Mobile responsive styles for dashboard hero */
@media (max-width: 768px) {
    .dashboard-title {
        font-size: 2rem;
    }
    
    .dashboard-subtitle {
        font-size: 1rem;
    }
    
    .dashboard-stats {
        gap: 1rem;
    }
    
    .stat-card {
        min-width: 100px;
        padding: 0.8rem 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* Old hero styles removed - using dashboard-hero instead */

/* Old hero content styles removed - using dashboard-hero styles instead */

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.feature-icon {
    font-size: 1.2rem;
}

/* Search Section */
.search-section {
    padding: 2rem 0;
    background: white;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.search-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-button {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: var(--primary-dark);
}

/* Exams Section */
.exams-section {
    padding: 4rem 0;
    background: var(--surface);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.exam-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.exam-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.exam-badge {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.exam-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.exam-specs {
    margin-bottom: 1.5rem;
}

.spec {
    background: var(--surface);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    border-left: 3px solid var(--primary-color);
}

.exam-link {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
    width: 100%;
}

.exam-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: white;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: white;
}

.faq-question {
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}

.faq-question:hover {
    background: #f0f0f0;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    transition: var(--transition);
}

.faq-item.active .faq-question::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
}

.faq-item.active .faq-answer {
    padding: 1.5rem;
    max-height: 200px;
}

.faq-answer p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
}

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

.footer-info h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-info p {
    color: #bdc3c7;
    line-height: 1.6;
}

.footer-links h4 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* Image Processing Styles */
.image-processor {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.upload-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.camera-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.camera-button:hover {
    background: #00b359;
}

/* Crop Tool Styles */
.crop-container {
    position: relative;
    max-width: 100%;
    margin: 2rem 0;
    background: #f0f0f0;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.crop-canvas-container {
    position: relative;
    overflow: hidden;
    cursor: grab;
}

.crop-canvas-container.dragging {
    cursor: grabbing;
}

.crop-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.crop-selection {
    position: absolute;
    border: 2px solid var(--accent-color);
    background: rgba(255, 107, 53, 0.1);
    cursor: move;
    pointer-events: all;
}

.crop-selection::before {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.crop-controls {
    padding: 1.5rem;
    background: var(--surface);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.zoom-button {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.zoom-button:hover {
    background: var(--primary-dark);
}

.zoom-level {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 60px;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background: #00b359;
}

/* Preview Styles */
.preview-container {
    margin: 2rem 0;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

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

.preview-item h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.preview-image {
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    max-width: 100%;
    height: auto;
    box-shadow: var(--shadow);
}

.preview-specs {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Error and Success Messages */
.message {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    font-weight: 500;
}

.message-error {
    background: #fee;
    color: #c53030;
    border: 1px solid #fed7d7;
}

.message-success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #c6f6d5;
}

.message-info {
    background: #ebf8ff;
    color: #2c5282;
    border: 1px solid #bee3f8;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Hero Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        padding: 1.5rem;
        margin: 0 1rem;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(1px);
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-features {
        gap: 1rem;
        justify-content: space-around;
    }
    
    .feature {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 1rem;
        background: rgba(255, 255, 255, 0.2);
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .hero-features {
        flex-direction: column;
        gap: 0.8rem;
    }
}

/* General Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-features {
        gap: 1rem;
    }
    
    .exams-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .exam-card {
        padding: 1.5rem;
    }
    
    .crop-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .zoom-controls {
        justify-content: center;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dashboard-hero {
        padding: 2rem 0;
        min-height: 400px;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .dashboard-subtitle {
        font-size: 1rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-input {
        border-bottom: 1px solid var(--border);
    }
    
    .privacy-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .image-processor {
        padding: 1rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .crop-controls {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .search-section,
    .footer {
        display: none;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .exam-card {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border: #000;
        --text-light: #333;
        --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .exam-card {
        border: 2px solid #000;
    }
    
    .upload-area {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
