/* TRA Membership Registration Form - Custom Styles */

:root {
    --primary-color: #0c4da2;
    --primary-hover: #0a3d82;
    --secondary-color: #ffffff;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #d1d5db;
    --success-color: #10b981;
    --error-color: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Tailwind Classes */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.hover\:bg-primary:hover {
    background-color: var(--primary-color) !important;
}

.hover\:border-primary:hover {
    border-color: var(--primary-color) !important;
}

.focus\:ring-primary:focus {
    --tw-ring-color: var(--primary-color) !important;
}

/* Form Animations */
input, select, textarea {
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(12, 77, 162, 0.1);
}

/* Radio Button Styling */
input[type="radio"]:checked {
    accent-color: var(--primary-color);
}

/* File Upload Drag & Drop */
#field_222f6f2:hover + label {
    border-color: var(--primary-color);
    background-color: rgba(12, 77, 162, 0.05);
}

/* File List Items */
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-item-remove {
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s;
}

.file-item-remove:hover {
    background-color: #fee2e2;
}

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

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

/* Progress Bar Animation */
#progressBar {
    transition: width 0.3s ease;
}

/* Back to Top Button */
#backToTop {
    transition: all 0.3s ease;
}

#backToTop.show {
    display: block !important;
}

/* Modal Animations */
#successModal, #errorModal {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    section {
        padding: 1rem !important;
    }

    .grid-cols-1 {
        grid-template-columns: 1fr;
    }
}

/* Custom Checkbox/Radio Styles */
label.flex.items-center.p-4 {
    cursor: pointer;
}

label.flex.items-center.p-4:has(input:checked) {
    border-color: var(--primary-color);
    background-color: rgba(12, 77, 162, 0.05);
}

/* Validation Error Styling */
.input-error {
    border-color: var(--error-color) !important;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success Input Styling */
.input-success {
    border-color: var(--success-color) !important;
}

/* Disabled State */
input:disabled, select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* OCR Preview */
#ocrPreview img {
    max-height: 300px;
    object-fit: contain;
    margin: 0 auto;
}

/* Language Toggle */
#languageToggle {
    transition: all 0.3s ease;
}

#languageToggle:hover {
    transform: scale(1.05);
}

/* Section Headers */
section h2 {
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Form Labels */
label {
    user-select: none;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Print Styles */
@media print {
    header, #backToTop, button {
        display: none;
    }

    section {
        page-break-inside: avoid;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner {
    border-width: 4px;
    width: 60px;
    height: 60px;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Thai Font Support */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
