﻿.success {
    color: green;
}

.error {
    color: red;
}

.preview {
    margin-top: 10px;
    border: 1px solid #ccc;
}

/* =========================
   HEADER
========================= */

.header-section {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d72 100%);
    color: #fff;
    padding: .25rem 0;
    margin-bottom: .5rem;
}

.form-section {
    background: #fff;
    
    padding: 2rem;
    margin-bottom: 2rem;
}

    .form-section i {
        padding-right: 3px;
    }

.section-title {
    color: #2c5aa0;
    border-bottom: 2px solid #2c5aa0;
    padding-bottom: .5rem;
    margin-bottom: 1.5rem;
}

/* =========================
   FORM
========================= */

.form-group {
    margin-bottom: 12px;
}

label {
    display: inline-block;
    font-weight: bold;
}

.required {
    color: #dc3545;
    font-weight: bold;
    animation: blink 2s infinite;
}

.form-control:focus,
#fullName:focus {
    border-color: #2c5aa0;
    box-shadow: 0 0 0 .2rem rgba(44,90,160,.25);
}

.name-capitalized {
    background-color: #f8f9fa !important;
    transition: background-color .3s ease;
}

.auto-filled {
    background-color: #d4edda !important;
    border-color: #28a745 !important;
}

/* =========================
   BUTTON
========================= */

.btn-primary {
    background-color: #2c5aa0;
    border-color: #2c5aa0;
}

    .btn-primary:hover {
        background-color: #1e3d72;
        border-color: #1e3d72;
    }

/* =========================
   UPLOAD
========================= */

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all .3s ease;
    cursor: pointer;
}

    .upload-area:hover {
        border-color: #2c5aa0;
        background-color: #f8f9fa;
    }

    .upload-area.dragover {
        border-color: #2c5aa0;
        background-color: #e3f2fd;
    }

.preview-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 1rem;
}

/* =========================
   VALIDATION
========================= */

.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 .2rem rgba(220,53,69,.25) !important;
    animation: shake .5s ease-in-out;
}

    .is-invalid:focus {
        border-color: #dc3545 !important;
        box-shadow: 0 0 0 .2rem rgba(220,53,69,.4) !important;
    }

.is-valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 .2rem rgba(40,167,69,.25) !important;
    animation: success-glow .5s ease-out;
}

.upload-area.is-invalid {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
    animation: pulse-error 1s infinite;
}

    .upload-area.is-invalid i {
        color: #dc3545 !important;
    }

    .upload-area.is-invalid p {
        color: #721c24 !important;
    }

.upload-area.is-valid {
    border-color: #28a745 !important;
    background-color: #d4edda !important;
}

.error-message {
    color: #dc3545;
    font-size: .875em;
    margin-top: .25rem;
    display: block;
    animation: fadeInDown .3s ease-out;
}

.msg-success {
    color: green;
    font-weight: bold;
}

.msg-error {
    color: red;
    font-weight: bold;
}

/* =========================
   QR SECTION
========================= */

.qr-section {
    background: linear-gradient(135deg,#f8f9fa 0%,#e9ecef 100%);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
    border: 2px solid #dee2e6;
}

.qr-code-container {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0,0,0,.1);
    margin: 1rem 0;
}

.qr-code-img {
    width: 200px;
    height: 200px;
    border: 2px solid #2c5aa0;
    border-radius: 8px;
    transition: opacity .3s ease;
}

    .qr-code-img.loading {
        opacity: .5;
    }

/* =========================
   PAYMENT
========================= */

.bank-info {
    background-color: #ffefd7;
    border-left: 4px solid #2c5aa0;
    padding: 1rem;
    margin: 1rem 0;
}

.payment-content {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #856404;
    margin: 1rem 0;
    word-break: break-all;
}

/* =========================
   NAME PREVIEW
========================= */

.name-preview {
    background: #e3f2fd;
    border: 1px solid #2c5aa0;
    border-radius: 5px;
    padding: .5rem;
    margin-top: .5rem;
    font-size: .9em;
    color: #1e3d72;
}

/* =========================
   PRINT
========================= */

.print-form-container {
    display: none;
    font-family: "Times New Roman", serif;
    font-size: 13pt;
    line-height: normal;
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 20px;
    background: #fff;
    color: #000;
}

.print-form-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 5px;
}

    .print-form-table td {
        padding: 8px 2px;
        vertical-align: top;
    }

.print-photo {
    width: 102px;
    height: 102px;
    border: 1px solid #000;
    object-fit: cover;
}

.print-checkbox {
    margin-right: 5px;
}

@media print {
    body * {
        visibility: hidden;
    }

    .print-form-container,
    .print-form-container * {
        visibility: visible;
    }

    .print-form-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        display: block !important;
    }

    .modal,
    .modal-backdrop {
        display: none !important;
    }
}

/* =========================
   ALERT
========================= */

.floating-alert {
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    border-radius: 8px;
    animation: slideInRight .3s ease-out;
}

.loading {
    display: none;
}

/* =========================
   ANIMATION
========================= */

@keyframes shake {
    0%,100% {
        transform: translateX(0);
    }

    10%,30%,50%,70%,90% {
        transform: translateX(-5px);
    }

    20%,40%,60%,80% {
        transform: translateX(5px);
    }
}

@keyframes pulse-error {
    0% {
        box-shadow: 0 0 0 0 rgba(220,53,69,.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220,53,69,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220,53,69,0);
    }
}

@keyframes success-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(40,167,69,.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(40,167,69,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(40,167,69,0);
    }
}

@keyframes blink {
    0%,50% {
        opacity: 1;
    }

    51%,100% {
        opacity: .5;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-success {
    0% {
        box-shadow: 0 0 0 0 rgba(40,167,69,.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(40,167,69,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(40,167,69,0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =========================
   TOOLTIP
========================= */

.validation-tooltip {
    position: absolute;
    top: -35px;
    left: 0;
    background: #dc3545;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: .8em;
    white-space: nowrap;
    z-index: 1000;
    animation: tooltipFadeIn .3s ease-out;
}

    .validation-tooltip::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 20px;
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid #dc3545;
    }

/* =========================
   EXAM SESSION
========================= */

#examSession.updated {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 .2rem rgba(40,167,69,.25) !important;
    background-color: #d4edda !important;
    animation: pulse-success 1s ease-out;
}
