/* Modern CSS for ROM ID Processor */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* CSS Variables for consistent theming */
:root {
    --primary-color: #007cba;
    --primary-light: #00a8e6;
    --primary-dark: #005a87;
    --secondary-color: #0099cc;
    --accent-color: #00d4ff;
    --success-color: #00c851;
    --warning-color: #ffbb33;
    --error-color: #ff4444;
    
    --bg-primary: #0a0a0a;
    --bg-secondary: rgba(20, 20, 20, 0.95);
    --bg-tertiary: rgba(30, 30, 30, 0.8);
    --bg-quaternary: rgba(40, 40, 40, 0.9);
    
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(0, 124, 186, 0.5);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    object-fit: cover;
    filter: brightness(0.7) contrast(1.1);
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 124, 186, 0.1) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: -1;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: linear-gradient(
        135deg,
        var(--primary-color) 0%,
        var(--primary-light) 30%,
        var(--accent-color) 70%,
        var(--secondary-color) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    position: relative;
}

.header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
    opacity: 0.8;
}

.header .subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.main-card,
.results-section {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.main-card::before,
.results-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

/* Form Styling */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.7;
}

/* Input Styling */
select,
input[type="text"] {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    position: relative;
}

select:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1);
    background: var(--bg-quaternary);
    transform: translateY(-1px);
}

select:hover,
input[type="text"]:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

select option {
    background: #2a2a2a;
    color: var(--text-primary);
    padding: 0.5rem;
}

input[type="text"]::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* File Upload Section */
.file-upload-section {
    background: var(--bg-tertiary);
    border: 2px dashed rgba(0, 124, 186, 0.3);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    margin: 2rem 0;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.file-upload-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 124, 186, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.file-upload-section:hover {
    border-color: var(--border-focus);
    background: rgba(40, 40, 40, 0.8);
    transform: translateY(-2px);
}

.file-upload-section:hover::before {
    opacity: 1;
}

.file-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

/* File Input Styling */
input[type="file"] {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 2rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

input[type="file"]::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.6s ease;
}

input[type="file"]:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

input[type="file"]:hover::before {
    left: 100%;
}

/* Checkbox Styling */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.checkbox-container:hover {
    color: var(--text-primary);
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 1.5rem 0;
    display: none;
    position: relative;
}

.progress-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width var(--transition-slow);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 1.5s infinite;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
    display: none;
}

/* Buttons */
.submit-btn,
.reset-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    padding: 1.25rem 2.5rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-width: 200px;
    margin: 0 auto;
}

.submit-btn:hover,
.reset-btn:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active,
.reset-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.reset-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    margin-top: 1rem;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #7c848d, #5a6268);
}

/* Results */
.rom-id-result {
    background: linear-gradient(135deg, rgba(0, 200, 81, 0.1), rgba(0, 124, 186, 0.1));
    border: 2px solid var(--success-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.rom-id-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 81, 0.1), transparent);
    animation: success-shine 3s infinite;
}

.rom-id-not-found {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.1), rgba(255, 187, 51, 0.1));
    border: 2px solid var(--error-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--error-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

/* Log Section */
.log-section {
    margin-top: 2rem;
}

.log-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.log-output {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
}

/* Info Section */
.info-section {
    background: rgba(0, 124, 186, 0.05);
    border: 1px solid rgba(0, 124, 186, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

.info-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.info-section p:last-child {
    margin-bottom: 0;
}

.info-section strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Scrollbar Styling */
.log-output::-webkit-scrollbar {
    width: 8px;
}

.log-output::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.log-output::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    border-radius: 4px;
}

.log-output::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-light), var(--primary-color));
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes success-shine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.main-card,
.results-section {
    animation: fadeInUp 0.8s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem 0.75rem;
    }
    
    .header {
        padding: 0.25rem 0;
        margin-bottom: 0.75rem;
    }
    
    .header h1 {
        font-size: 2.2rem;
        margin-bottom: 0.5rem;
    }
    
    .header .subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
    
    .main-card,
    .results-section {
        padding: 1.25rem;
        border-radius: var(--radius-md);
        margin-bottom: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    select, input[type="text"] {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
        min-height: 48px; /* Touch-friendly minimum */
    }
    
    .file-upload-section {
        padding: 1.25rem;
        margin: 1.5rem 0;
        border-radius: var(--radius-md);
    }
    
    .file-input-container {
        gap: 1rem;
    }
    
    input[type="file"] {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
        min-height: 48px;
        width: 100%;
        max-width: none;
    }
    
    .checkbox-container {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .checkbox-container label {
        font-size: 0.85rem;
        margin-bottom: 0;
        text-align: center;
    }
    
    .submit-btn,
    .reset-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
        border-radius: var(--radius-sm);
        width: 100%;
        margin-top: 1rem;
    }
    
    .progress-container {
        margin: 1rem 0;
        height: 6px;
    }
    
    .progress-text {
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }
    
    .rom-id-result,
    .rom-id-not-found {
        font-size: 1.1rem;
        padding: 1.25rem;
        border-radius: var(--radius-md);
        margin-bottom: 1.5rem;
        word-break: break-all;
    }
    
    .log-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .log-output {
        height: 250px;
        font-size: 0.8rem;
        padding: 1rem;
        border-radius: var(--radius-sm);
    }
    
    .info-section {
        padding: 1rem;
        margin-top: 1.5rem;
        border-radius: var(--radius-sm);
    }
    
    .info-section p {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
}

/* Samsung S22 specific optimizations (360px - 412px width) */
@media (max-width: 412px) {
    .container {
        padding: 0.5rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .header .subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .main-card,
    .results-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .form-grid {
        gap: 1rem;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    select, input[type="text"] {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .file-upload-section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    input[type="file"] {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .checkbox-container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .checkbox-container label {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .rom-id-result,
    .rom-id-not-found {
        font-size: 1rem;
        padding: 1rem;
        line-height: 1.3;
    }
    
    .log-output {
        height: 200px;
        font-size: 0.75rem;
        padding: 0.75rem;
    }
    
    .info-section {
        padding: 0.75rem;
    }
    
    .info-section p {
        font-size: 0.8rem;
        line-height: 1.4;
    }
}

/* Improved touch targets for mobile */
@media (max-width: 768px) {
    select, input[type="text"], input[type="file"], button {
        -webkit-appearance: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Ensure dropdowns work well on mobile */
    select {
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 1rem center;
        background-size: 1rem;
        padding-right: 3rem;
    }
    
    /* Better focus states for mobile */
    select:focus, input[type="text"]:focus, input[type="file"]:focus {
        transform: none;
        box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.3);
    }
    
    /* Prevent zoom on input focus for iOS */
    select, input[type="text"] {
        font-size: 16px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --text-secondary: #d0d0d0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .video-background,
    .video-overlay,
    .submit-btn,
    .reset-btn {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .main-card,
    .results-section {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }
} 