/* RTI Helper - Mobile-First CSS with Dark Theme */

/* CSS Custom Properties */
:root {
    --bg-primary: #0F172A;
    --surface-dark: #111827;
    --card-bg: #1F2937;
    --text-primary: #FFFFFF;
    --accent-blue: #38BDF8;
    --success-green: #22C55E;
    --warning-yellow: #F59E0B;
    --muted: #9CA3AF;
    --danger-red: #EF4444;
    --border-color: #374151;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.25rem;
}

h3 {
    font-size: 1.125rem;
}

h4 {
    font-size: 1rem;
}

/* Header */
.header {
    background-color: var(--surface-dark);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    color: var(--accent-blue);
    margin-bottom: 0.25rem;
}

.tagline {
    color: var(--muted);
    font-size: 0.875rem;
}

/* Hero Section */
.hero {
    padding: 2rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--surface-dark) 100%);
}

.hero-title {
    font-size: 1.75rem;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.hero-description {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

/* Buttons */
.cta-button, .generate-button, .action-button {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0ea5e9 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-button:hover, .generate-button:hover, .action-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.cta-button:active, .generate-button:active, .action-button:active {
    transform: translateY(0);
}

.action-button {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.action-button:hover {
    background: var(--surface-dark);
}

/* Input Section */
.input-section {
    padding: 2rem 0;
    background-color: var(--surface-dark);
}

.input-section h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--accent-blue);
}

/* Forms */
.rti-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.helper-text {
    color: var(--muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Output Section */
.output-section {
    padding: 2rem 0;
}

.result-card {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.result-card h3 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Draft Content */
.draft-content {
    background-color: var(--surface-dark);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    line-height: 1.5;
    border-left: 4px solid var(--accent-blue);
}

.draft-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Fee Info */
.fee-info {
    display: grid;
    gap: 1rem;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--surface-dark);
    border-radius: 0.5rem;
    border-left: 4px solid var(--success-green);
}

.fee-amount {
    font-weight: 600;
    color: var(--success-green);
    font-size: 1.125rem;
}

/* Timeline */
.timeline-info {
    display: grid;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--surface-dark);
    border-radius: 0.5rem;
    border-left: 4px solid var(--warning-yellow);
}

.timeline-icon {
    font-size: 1.25rem;
}

.timeline-text {
    flex: 1;
}

.timeline-deadline {
    font-weight: 600;
    color: var(--warning-yellow);
}

/* Countdown */
.countdown {
    background: linear-gradient(135deg, var(--warning-yellow) 0%, #f59e0b 100%);
    color: var(--bg-primary);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

.countdown-number {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Appeal Process */
.appeal-steps {
    display: grid;
    gap: 1rem;
}

.appeal-step {
    background-color: var(--surface-dark);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--accent-blue);
}

.appeal-step-number {
    background: var(--accent-blue);
    color: var(--bg-primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.appeal-authority {
    color: var(--accent-blue);
    font-weight: 600;
}

/* Mistakes List */
.mistakes-list {
    display: grid;
    gap: 1rem;
}

.mistake-item {
    background-color: var(--surface-dark);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--danger-red);
}

.mistake-title {
    color: var(--danger-red);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.mistake-explanation {
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.mistake-solution {
    color: var(--success-green);
    font-style: italic;
}

/* Alternatives */
.alternatives-list {
    display: grid;
    gap: 1rem;
}

.alternative-item {
    background-color: var(--surface-dark);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--warning-yellow);
}

.alternative-situation {
    color: var(--warning-yellow);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.alternative-solution {
    color: var(--success-green);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.alternative-reason {
    color: var(--muted);
    font-size: 0.875rem;
}

/* Disclaimer */
.disclaimer {
    padding: 2rem 0;
    background-color: var(--surface-dark);
}

.disclaimer-box {
    background-color: var(--card-bg);
    border: 2px solid var(--warning-yellow);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
}

.disclaimer-box h4 {
    color: var(--warning-yellow);
    margin-bottom: 1rem;
}

.disclaimer-box ul {
    list-style: none;
    margin-top: 1rem;
}

.disclaimer-box li {
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.disclaimer-box li::before {
    content: "⚠️ ";
    margin-right: 0.5rem;
}

/* Footer */
.footer {
    background-color: var(--surface-dark);
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--accent-blue);
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Responsive Design - Tablet */
@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .logo {
        font-size: 1.75rem;
    }
    
    .fee-info {
        grid-template-columns: 1fr 1fr;
    }
    
    .timeline-info {
        grid-template-columns: 1fr 1fr;
    }
    
    .draft-actions {
        justify-content: flex-start;
    }
}

/* Responsive Design - Desktop */
@media (min-width: 1024px) {
    .container {
        padding: 0 3rem;
    }
    
    .hero {
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .fee-info {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .timeline-info {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .appeal-steps {
        grid-template-columns: 1fr 1fr;
    }
    
    .mistakes-list {
        grid-template-columns: 1fr 1fr;
    }
    
    .alternatives-list {
        grid-template-columns: 1fr 1fr;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success States */
.success-message {
    background-color: var(--success-green);
    color: var(--bg-primary);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    text-align: center;
    font-weight: 600;
}

/* Error States */
.error-message {
    background-color: var(--danger-red);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    text-align: center;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

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

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Print Styles */
@media print {
    .header, .hero, .input-section, .disclaimer, .footer {
        display: none;
    }
    
    .output-section {
        padding: 0;
    }
    
    .result-card {
        border: 1px solid #000;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .draft-content {
        background: white;
        border: 1px solid #000;
        color: black;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --bg-primary: #000000;
        --surface-dark: #000000;
        --card-bg: #1a1a1a;
        --text-primary: #ffffff;
        --border-color: #666666;
    }
}
