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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #faf5ff 100%);
}

.container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 500px;
    transition: all 0.5s ease;
}

/* .container.expanded {
    margin: 1.25em;
    max-width: min(95%, 800px);
} */

.header {
    /* background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); */
    color: #133886;
    padding: 30px 30px;
    text-align: center;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header div {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header img{
    width: 80px;
    /* margin-right: 10px; */
}

.header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 0px;
    line-height: 1.4;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

.header-address {
    font-size: 14px !important;
    opacity: 0.85;
    margin-top: 6px;
}

.form-wrapper {
    padding: 40px 30px;
    position: relative;
    transition: all 0.5s ease;
}

.exam-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.exam-info h3 {
    color: #166534;
    font-size: 15px;
    margin-bottom: 10px;
}

.exam-info ul {
    list-style: none;
    padding-left: 16px;
}

.exam-info ul li {
    color: #374151;
    font-size: 14px;
    padding: 3px 0;
    position: relative;
}

.exam-info ul li::before {
    content: '–';
    position: absolute;
    left: -16px;
    color: #6b7280;
}

.section-label {
    color: #374151;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    transition: all 0.4s ease;
}

.section-label.hidden {
    display: none;
}

.form-container {
    transition: all 0.4s ease;
    opacity: 1;
}

.form-container.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    position: absolute;
    width: 100%;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f9fafb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.btn {
    width: 100%;
    padding: .8em 1.2em;
    /* background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); */
    color: #133886;
    border: 2px solid #133886;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    /* box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3), 0 6px 12px rgba(79, 70, 229, 0.4);
    color: white;
    background: linear-gradient(135deg, #4f46e5 0%, #133886 100%);
}

.btn:active {
    transform: translateY(0);
}

.btn.outline {
    background: transparent;
    border: 2px solid #4f46e5;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.btn.primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
}

.result-container {
    display: none;
    transform: translateY(20px);
    transition: all 0.5s ease;
    pointer-events: none;
}

.result-container.show {
    display: block;
    transform: translateY(0);
    pointer-events: auto;
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.result-header h2 {
    color: #374151;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-header h3 {
    color: #6b7280;
    font-size: 16px;
    font-weight: 400;
}

.result-header-inline {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.result-header-inline h2 {
    color: #374151;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.result-header-inline h3 {
    color: #6b7280;
    font-size: 14px;
    font-weight: 400;
}

.exam-time-info {
    background: #f0fdf4;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
}

.exam-time-info p {
    margin: 2px 0;
}

.room-section {
    text-align: center;
    margin-top: 16px;
}

.room-label {
    color: #374151;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.result-content {
    display: grid;
    gap: 1rem;
    animation: slideInUp 0.6s ease 0.2s both;
}

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

.result-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: white;
}

.result-card:nth-child(2) {
    animation-delay: 0.1s;
}

.result-card:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 15px;
    font-size: 1.25rem;
    text-align: left;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
    text-align: right;
    max-width: 60%;
}

.info-value.highlight {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
}

.room-highlight {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 8px auto;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    display: inline-block;
    min-width: 100px;
}

.location-text {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
    padding: 10px 0;
    text-align: center;
    font-style: italic;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.mt-4 {
    margin-top: 1rem;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 1rem;
}

/* Multiple results separator */
.result-card + .result-card {
    margin-top: 0;
}

@media (max-width: 768px) {
    .result-content {
        gap: .8em;
    }

    .container.expanded {
        margin: .5em;
        max-width: 95%;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-value {
        text-align: left;
        max-width: 100%;
    }
}

/* Map Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    /* padding: 24px; */
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.3s ease;
}

.modal-content h3 {
    margin-bottom: 16px;
    color: #374151;
    font-size: 18px;
}

.modal-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    display: block;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.modal-close:hover {
    color: #111827;
}

.map-link {
    color: #4f46e5;
    text-decoration: underline;
    cursor: pointer;
    font-style: italic;
}

.map-link:hover {
    color: #7c3aed;
}

@media (max-width: 480px) {
    .container {
        margin: 10px;
        border-radius: 16px;
    }

    .header {
        padding: 30px 20px;
    }

    .form-wrapper {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .button-group {
        flex-direction: column;
        gap: 8px;
    }

    .button-group .btn {
        width: 100%;
    }
}

/* Print styles */
@media print {
    body {
        margin: 15px;
        font-size: 12px;
        background: white;
    }

    .header {
        background: none !important;
        color: #000 !important;
        padding: 20px 0;
    }

    .header h1, .header p {
        color: #000 !important;
    }

    .form-wrapper {
        margin: 0;
        padding: 0;
    }

    .form-container,
    .loading,
    .error-message,
    .button-group {
        display: none !important;
    }

    .container {
        max-width: none;
        box-shadow: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
    }

    .result-container {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
    }

    .result-card {
        opacity: 1 !important;
        transform: none !important;
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .room-highlight {
        background: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .info-value.highlight {
        background: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
