/* Add futuristic color variables */
:root {
    --neon-blue: #00f3ff;
    --neon-purple: #9d00ff;
    --neon-pink: #ff00f7;
    --dark-bg: #0a0a0a;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

html, body {
    height: 100%; /* Ensure html and body take full viewport height */
    margin: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background: linear-gradient(45deg, var(--dark-bg), #1a1a1a);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Enable vertical scrolling if content overflows */
    color: #fff;
}

.container {
    display: flex;
    gap: 30px;
    width: 90%;
    max-width: 1400px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border-radius: 15px;
    position: relative;
    min-height: 80vh; /* Ensure container is tall enough */
    align-items: flex-start; /* Align items to the start to prevent vertical stretching */
    animation: glowPulse 3s infinite;
}

.form-section {
    flex: 1;
    padding: 30px;
    border-right: 1px solid #dcdcdc;
    background: linear-gradient(45deg, rgba(0, 243, 255, 0.1), rgba(255, 0, 255, 0.1));
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    transition: all 0.3s ease;
}

.form-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.45);
}

.form-section h1 {
    color: var(--neon-blue);
    margin-bottom: 30px;
    text-align: center;
    font-size: 2.2em;
    border-bottom: 3px solid var(--neon-blue);
    padding-bottom: 12px;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
    justify-content: space-between;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-group label {
    width: 95%;
    text-align: left;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 95%;
    padding: 10px 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #333;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    height: 40px;
    margin: 0 auto;
    display: block;
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    outline: none;
    background: rgba(255, 255, 255, 0.1);
}

/* Special styling for date input */
input[type="date"] {
    width: 95%;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 35px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2300f3ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
}

/* Special styling for number input */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Special styling for select */
select {
    width: 95%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2300f3ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    padding-right: 30px;
}

.form-section button {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.form-section button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 243, 255, 0.4);
}

.form-section button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 5px var(--neon-blue), 0 0 10px var(--neon-purple); }
    50% { box-shadow: 0 0 20px var(--neon-blue), 0 0 30px var(--neon-purple); }
    100% { box-shadow: 0 0 5px var(--neon-blue), 0 0 10px var(--neon-purple); }
}

.receipt-section {
    flex: 2;
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    min-height: 600px; /* Explicit minimum height for content */
    box-sizing: border-box; /* Include padding in the element's total width and height */
    animation: floatAnimation 6s ease-in-out infinite;
}

.receipt-section.show {
    opacity: 1;
    transform: translateY(0);
}

.receipt-section:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.45);
}

.receipt-header {
    text-align: center;
    margin-bottom: 30px;
}

.receipt-header h2 {
    color: var(--neon-pink);
    margin-bottom: 8px;
    font-size: 2.5em;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 0, 247, 0.5);
}

.receipt-header p {
    margin: 0;
    color: #7f8c8d; /* Muted grey */
    font-size: 1.1em;
}

.receipt-header hr {
    border: none;
    border-top: 3px solid var(--neon-pink);
    margin-top: 15px;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 10px rgba(255, 0, 247, 0.3);
}

.receipt-title {
    text-align: center;
    margin-bottom: 30px;
}

.receipt-title h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8em;
    text-transform: uppercase;
}

.receipt-title p {
    margin: 5px 0;
    color: #555;
    font-size: 1em;
}

.details-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    border: 1px solid #e0e0e0;
    padding: 20px;
    background-color: #ecf0f1; /* Light grey background */
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.student-details,
.course-details {
    flex: 1;
    padding: 0 15px;
}

.student-details h4,
.course-details h4 {
    color: #34495e;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 700;
    border-bottom: 1px dashed #bdc3c7;
    padding-bottom: 8px;
}

.student-details p,
.course-details p {
    margin: 8px 0;
    color: #555;
    line-height: 1.5;
}

.student-details p strong,
.course-details p strong {
    min-width: 100px; /* Aligned labels */
    display: inline-block;
    color: #34495e;
}

.contact-info {
    text-align: center;
    margin-top: 50px;
    font-size: 0.9em;
    color: #7f8c8d;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.director-signature {
    text-align: right;
    margin-top: 60px;
}

.director-signature .signature-image {
    width: 120px;
    height: 60px;
    border: none;
    display: block;
    margin-left: auto;
    margin-bottom: 8px;
    background-color: transparent;
    object-fit: cover;
    box-shadow: none;
}

.director-signature p {
    margin: 0;
    font-size: 1em;
    color: #555;
    font-style: italic;
}

#printReceipt {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#printReceipt:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 243, 255, 0.4);
}

#printReceipt::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes floatAnimation {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@media print {
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    .container {
        display: block !important; /* Force block display for print */
        width: 100% !important;
        max-width: none !important; /* Remove max-width constraint for print */
        padding: 0 !important; /* Remove container padding for print */
        box-shadow: none !important; /* Remove shadows for print */
        border-radius: 0 !important; /* Remove border-radius for print */
        min-height: auto !important; /* Remove min-height for print */
        align-items: flex-start !important; /* Reset align-items */
        background: white;
    }

    body * {
        visibility: hidden;
    }
    .receipt-section, .receipt-section * {
        visibility: visible;
    }
    .receipt-section {
        width: 210mm;
        height: 297mm;
        padding: 10mm;
        margin: 0;
        border: none;
        background: white;
    }

    .receipt-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        font-size: 0.8em;
        line-height: 1.2;
    }

    .receipt-details p {
        margin: 2px 0;
        display: inline-block;
        width: 48%;
    }

    .receipt-header {
        margin-bottom: 10px;
    }

    .receipt-header h2 {
        font-size: 1.1em;
        margin-bottom: 3px;
    }

    .receipt-header p {
        font-size: 0.75em;
        margin: 1px 0;
    }

    .receipt-footer {
        margin-top: 10px;
        font-size: 0.75em;
    }

    .receipt-footer p {
        margin: 1px 0;
    }

    .form-section, #printReceipt {
        display: none !important;
    }

    .success-animation {
        display: none;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group:last-child {
        margin-bottom: 0;
    }

    .container {
        padding: 15px;
    }
    
    .form-section, .receipt-section {
        padding: 20px;
    }
    
    .form-group input,
    .form-group select {
        width: 100%;
    }
    
    .success-animation {
        font-size: 60px;
    }
    
    .receipt-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .receipt-value {
        text-align: left;
        margin-left: 0;
    }
}

/* Add loading animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.form-section button:active {
    animation: pulse 0.3s ease;
}

/* Add glow effect to labels */
.form-section input:hover,
.form-section select:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 10px rgba(157, 0, 255, 0.3);
}

/* Add transition effects */
.receipt-section {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add responsive hover effects */
@media (hover: hover) {
    .form-section input:hover,
    .form-section select:hover {
        transform: translateY(-2px);
    }
}

/* Add loading state styles */
.form-section.loading {
    position: relative;
}

.form-section.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Enhanced success animation */
.success-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    color: var(--neon-blue);
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
    animation: successPulse 2s ease-out;
    z-index: 1000;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.2) 0%, transparent 70%);
    padding: 20px;
    border-radius: 50%;
}

@keyframes successPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Enhanced receipt details styling */
.receipt-details {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.receipt-row:last-child {
    border-bottom: none;
}

.receipt-label {
    font-weight: bold;
    color: var(--neon-blue);
    min-width: 150px;
}

.receipt-value {
    color: #333;
    text-align: right;
    flex: 1;
    margin-left: 20px;
}

/* Course Section Styles */
.course-section {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
}

.course-section label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 8px;
    display: block;
}

.course-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #3498db;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    font-size: 1em;
    transition: all 0.3s ease;
}

.course-input:focus {
    border-color: #2980b9;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
    background: #fff;
}

/* Payment Section Styles */
.payment-section {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.1);
}

.payment-section label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 8px;
    display: block;
}

.payment-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #2ecc71;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    font-size: 1em;
    transition: all 0.3s ease;
}

.payment-input:focus {
    border-color: #27ae60;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
    background: #fff;
}

/* Batch Section Styles */
.batch-section {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.1);
}

.batch-section label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 8px;
    display: block;
}

.batch-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #9b59b6;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    font-size: 1em;
    transition: all 0.3s ease;
    cursor: pointer;
}

.batch-input:focus {
    border-color: #8e44ad;
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.3);
    background: #fff;
}

/* Hover Effects */
.course-input:hover,
.payment-input:hover,
.batch-input:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .course-section,
    .payment-section,
    .batch-section {
        padding: 10px;
        margin-bottom: 10px;
    }

    .course-input,
    .payment-input,
    .batch-input {
        padding: 8px 12px;
        font-size: 0.9em;
    }
} 