/* Modern Color Palette */
body {
    background: linear-gradient(135deg, #4568dc, #b06ab3);
    background-attachment: fixed;
    padding: 20px;
    min-height: 100vh;
    color: #2d3436;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(69, 104, 220, 0.15);
    width: 95%;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

h1 {
    text-align: center;
    color: #4568dc;
    margin: 20px 0 40px;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    word-wrap: break-word;
    position: relative;
}

h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, #4568dc, #b06ab3);
    margin: 15px auto 0;
    border-radius: 2px;
}

.form-group {
    margin-bottom: 30px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #2d3436;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e8ecf3;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #2d3436;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

input:focus,
select:focus {
    border-color: #4568dc;
    box-shadow: 0 0 0 4px rgba(69, 104, 220, 0.1);
    outline: none;
    transform: translateY(-2px);
}

input[type="file"] {
    padding: 12px 0;
    cursor: pointer;
    font-size: 0.95rem;
}

.payment-details {
    display: none;
    padding: 25px;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    border-radius: 16px;
    margin-bottom: 25px;
    border: 1px solid #e8ecf3;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.submit-btn {
    background: linear-gradient(135deg, #4568dc, #b06ab3);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(69, 104, 220, 0.2);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(69, 104, 220, 0.3);
}

.submit-btn:after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0;
}

.submit-btn:hover:after {
    opacity: 1;
    transform: rotate(45deg) translate(50%, 50%);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(45, 52, 54, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    margin: 5% auto;
    padding: 40px;
    width: clamp(280px, 90%, 600px);
    border-radius: 24px;
    position: relative;
    box-shadow: 0 20px 50px rgba(69, 104, 220, 0.3);
    animation: modalSlide 0.4s ease;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes modalSlide {
    from {
        transform: translateY(-70px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #636e72;
    transition: all 0.3s ease;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(236, 240, 241, 0.5);
}

.close:hover {
    color: #4568dc;
    background-color: rgba(69, 104, 220, 0.1);
    transform: rotate(90deg);
}

#receipt {
    margin: 25px 0;
    padding: 35px;
    border: 1px solid #e8ecf3;
    border-radius: 20px;
    background: linear-gradient(to bottom right, #ffffff, #fafafa);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

#receipt .header {
    border-bottom: 2px solid #e8ecf3;
    padding-bottom: 25px;
    margin-bottom: 30px;
    text-align: center;
}

#receipt .detail {
    margin: 25px 0;
    padding: 25px;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.5), rgba(250, 250, 250, 0.5));
    border-radius: 16px;
    border: 1px solid #e8ecf3;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

#receipt h2 {
    color: #4568dc;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

#receipt h3 {
    color: #2d3436;
    margin-bottom: 20px;
    border-bottom: 2px solid #e8ecf3;
    padding-bottom: 12px;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#receipt p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 12px;
    color: #2d3436;
}

#downloadBtn {
    background: linear-gradient(135deg, #4568dc, #b06ab3);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: block;
    margin: 30px auto 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: fit-content;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(69, 104, 220, 0.2);
}

#downloadBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(69, 104, 220, 0.3);
}

.logo-container {
    text-align: center;
    margin-bottom: 35px;
    padding: 20px;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(69, 104, 220, 0.15);
}

.school-logo {
    max-width: 160px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(69, 104, 220, 0.15);
    transition: transform 0.3s ease;
}

.school-logo:hover {
    transform: scale(1.05);
}

.receipt-logo {
    max-width: 130px;
    height: auto;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(69, 104, 220, 0.15);
}

/* Base touch improvements */
@media (hover: none) {
    input, 
    select, 
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    input[type="file"] {
        padding: 15px 0;
    }

    .submit-btn,
    #downloadBtn {
        padding: 16px 24px;
        -webkit-tap-highlight-color: transparent;
    }

    .close {
        padding: 15px;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Tablet Devices */
@media (max-width: 1024px) {
    .container {
        padding: 30px;
        width: 90%;
    }

    h1 {
        font-size: 2rem;
        margin: 15px 0 30px;
    }

    .form-group {
        margin-bottom: 25px;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="date"],
    select {
        padding: 12px 16px;
    }

    .payment-details {
        padding: 20px;
    }

    #receipt {
        padding: 25px;
    }
}

/* Large Mobile Devices */
@media (max-width: 768px) {
    body {
        padding: 15px 10px;
    }

    .container {
        padding: 25px 20px;
        margin: 10px auto;
        width: 95%;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 20px;
        width: 95%;
    }

    h1 {
        font-size: 1.8rem;
        margin: 15px 0 25px;
    }

    h1::after {
        width: 60px;
        margin: 12px auto 0;
    }

    .form-group {
        margin-bottom: 20px;
    }

    label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="date"],
    select {
        padding: 12px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .submit-btn {
        padding: 14px 20px;
        font-size: 1rem;
    }

    #receipt {
        padding: 20px;
        margin: 15px 0;
    }

    #receipt h2 {
        font-size: 1.6rem;
    }

    #receipt h3 {
        font-size: 1.2rem;
    }

    #receipt p {
        font-size: 0.95rem;
    }

    .school-logo {
        max-width: 120px;
    }

    .receipt-logo {
        max-width: 100px;
    }

    #downloadBtn {
        padding: 12px 24px;
        font-size: 0.95rem;
        width: 100%;
        min-width: unset;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    body {
        padding: 10px 5px;
    }

    .container {
        padding: 20px 15px;
        margin: 5px auto;
        border-radius: 20px;
    }

    h1 {
        font-size: 1.5rem;
        margin: 10px 0 20px;
    }

    h1::after {
        width: 50px;
        margin: 10px auto 0;
    }

    .form-group {
        margin-bottom: 15px;
    }

    label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="date"],
    select {
        padding: 10px;
        font-size: 0.95rem;
        border-radius: 8px;
    }

    .payment-details {
        padding: 15px;
        margin-bottom: 15px;
    }

    .submit-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .modal-content {
        padding: 15px;
        border-radius: 16px;
    }

    .close {
        right: 15px;
        top: 15px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }

    #receipt {
        padding: 15px;
        margin: 10px 0;
    }

    #receipt .header {
        padding-bottom: 15px;
        margin-bottom: 20px;
    }

    #receipt .detail {
        padding: 15px;
        margin: 15px 0;
    }

    #receipt h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    #receipt h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    #receipt p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 8px;
    }

    .school-logo {
        max-width: 100px;
    }

    .receipt-logo {
        max-width: 80px;
        margin-bottom: 15px;
    }
}

/* iPhone 5/SE and other small devices */
@media (max-width: 320px) {
    .container {
        padding: 15px 10px;
    }

    h1 {
        font-size: 1.3rem;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="date"],
    select {
        padding: 8px;
        font-size: 0.9rem;
    }

    .submit-btn,
    #downloadBtn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* iPad Pro and other large tablets */
@media (min-width: 1024px) and (max-width: 1366px) {
    .container {
        max-width: 900px;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="date"],
    select {
        padding: 16px 20px;
        font-size: 1.1rem;
    }

    .submit-btn {
        padding: 18px 36px;
        font-size: 1.2rem;
    }
}

/* Landscape Mode Optimizations */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        margin: 5px auto;
    }

    .modal-content {
        margin: 2% auto;
        max-height: 95vh;
    }

    .form-group {
        margin-bottom: 15px;
    }

    h1 {
        margin: 10px 0 20px;
    }

    .school-logo {
        max-width: 100px;
    }
}

/* High-DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .school-logo,
    .receipt-logo {
        transform: translateZ(0);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modal {
        background-color: rgba(0, 0, 0, 0.9);
    }
}

/* Print styles */
@media print {
    body {
        background: none;
        padding: 0;
    }

    .container {
        box-shadow: none;
        padding: 0;
        margin: 0;
        width: 100%;
    }

    #receipt {
        border: none;
        padding: 0;
    }

    .modal-content {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }

    #downloadBtn,
    .close {
        display: none;
    }
} 