/* ATAR Calculator Custom Styles */

#curriculum-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#curriculum-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Print Styles for PDF Generation */
@media print {
    @page {
        margin: 1in;
        size: A4;
    }

    body {
        font-family: 'Inter', Arial, sans-serif;
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: white;
    }

    /* Hide elements that shouldn't be printed */
    nav,
    footer,
    .no-print,
    button,
    #add-subject-btn,
    #clear-all,
    #copy-results,
    #save-pdf,
    .remove-subject {
        display: none !important;
    }

    /* Adjust layout for print */
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    /* Results styling for print */
    #results-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .subject-input-group {
        break-inside: avoid;
        margin-bottom: 12pt;
        border: 1px solid #ccc;
        padding: 8pt;
    }

    /* Header for printed version */
    .print-header {
        display: none;
    }

    @media print {
        .print-header {
            display: block;
            text-align: center;
            margin-bottom: 20pt;
            padding-bottom: 10pt;
            border-bottom: 2px solid #333;
        }

        .print-header h1 {
            font-size: 18pt;
            font-weight: bold;
            margin: 0 0 8pt 0;
        }

        .print-header p {
            font-size: 12pt;
            color: #666;
            margin: 0;
        }
    }

    /* ATAR score styling for print */
    .atar-score-print {
        font-size: 24pt;
        font-weight: bold;
        text-align: center;
        padding: 12pt;
        border: 2px solid #333;
        margin: 12pt 0;
    }

    /* Subject breakdown for print */
    .subject-breakdown-print {
        width: 100%;
        border-collapse: collapse;
        margin: 12pt 0;
    }

    .subject-breakdown-print th,
    .subject-breakdown-print td {
        border: 1px solid #333;
        padding: 6pt;
        text-align: left;
    }

    .subject-breakdown-print th {
        background-color: #f0f0f0;
        font-weight: bold;
    }

    /* Disclaimer for print */
    .print-disclaimer {
        display: none;
        font-size: 10pt;
        color: #666;
        margin-top: 20pt;
        padding-top: 10pt;
        border-top: 1px solid #ccc;
    }

    @media print {
        .print-disclaimer {
            display: block;
        }
    }
}

/* Screen-only enhancements */
@media screen {
    /* Smooth animations for better UX */
    .subject-input-group {
        transition: all 0.3s ease;
    }

    .subject-input-group:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    /* Focus states */
    .subject-select:focus,
    .score-input:focus {
        outline: 2px solid #424ea8;
        outline-offset: 1px;
        border-color: #424ea8;
        box-shadow: 0 0 0 3px rgba(66, 78, 168, 0.2);
    }

    /* Loading states */
    .calculating {
        opacity: 0.7;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    /* Error states */
    .error-input {
        border-color: #ef4444;
        background-color: #fef2f2;
    }

    .error-input:focus {
        ring-color: #ef4444;
    }

    /* Success states */
    .success-input {
        border-color: #10b981;
        background-color: #f0fdf4;
    }

    /* Toast notifications */
    .toast {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 1000;
        padding: 1rem 1.5rem;
        border-radius: 0.5rem;
        color: white;
        font-weight: 500;
        shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .toast.show {
        transform: translateX(0);
    }

    .toast.success {
        background-color: #10b981;
    }

    .toast.error {
        background-color: #ef4444;
    }

    .toast.info {
        background-color: #3b82f6;
    }

    /* Responsive adjustments */
    @media (max-width: 640px) {
        .atar-results-panel {
            position: static;
        }

        .subject-input-group {
            margin-bottom: 1rem;
        }

        .subject-input-group .flex {
            flex-direction: column;
            gap: 1rem;
        }

        .subject-input-group .sm\:flex-row {
            flex-direction: column !important;
        }

        .subject-input-group .sm\:w-32 {
            width: 100% !important;
        }
    }

    /* Dark mode support (if needed in future) */
    @media (prefers-color-scheme: dark) {
        :root {
            --bg-color: #1f2937;
            --text-color: #f9fafb;
            --border-color: #374151;
        }
    }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .subject-select,
    .score-input {
        border-width: 2px;
        border-color: #000;
    }

    button {
        border: 2px solid #000;
    }
}

/* Additional utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Animation keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-slideIn {
    animation: slideIn 0.3s ease-out;
}
