:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --radius: 16px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background: var(--bg-color);
    position: relative;
    padding: 20px;
    overflow: hidden;
    min-height: 100vh;
}

/* Background Blobs */
.blob {
    position: absolute;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(245, 158, 11, 0.05));
    filter: blur(60px);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.blob-1 {
    top: -100px;
    right: -100px;
    animation: drift 10s infinite alternate ease-in-out;
}

.blob-2 {
    bottom: -100px;
    left: -100px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(37, 99, 235, 0.05));
    animation: drift 12s infinite alternate-reverse ease-in-out;
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(30px, 20px) scale(1.1); }
}

header, .step, .overlay {
    position: relative;
    z-index: 1;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
}

.logo span span {
    color: var(--text-main);
}

.badge {
    background: #e0e7ff;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Section Styling */
.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Steps */
.step {
    display: none;
    animation: slideIn 0.4s ease-out forwards;
}

.step.active {
    display: block;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Card Styling */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.input-group {
    margin-bottom: 20px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: #f1f5f9;
    font-size: 1rem;
    font-weight: 500;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

/* Student List */
.student-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.student-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.student-item.selected {
    border-color: var(--primary);
    background: #eff6ff;
}

.student-item .checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
}

.student-item.selected .checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.student-item .student-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Product Selection */
.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.product-card.active {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.product-icon {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.product-card h3 {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.price {
    font-weight: 700;
    color: var(--primary);
}

.check-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--primary);
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.product-card.active .check-icon {
    opacity: 1;
}

/* Action Bar */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    box-shadow: 0 -10px 20px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 480px;
    margin: 0 auto;
    z-index: 100;
}

.total-summary {
    display: flex;
    flex-direction: column;
}

.total-summary .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.total-summary .amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary.disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 20px;
    cursor: pointer;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-main);
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    width: 100%;
    margin-top: 20px;
    cursor: pointer;
}

/* Bank Grid */
.bank-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 120px;
}

.bank-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border: 2px solid transparent;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.bank-item img {
    height: 30px;
    max-width: 100%;
    object-fit: contain;
}

.bank-item span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.bank-item.selected {
    border-color: var(--primary);
    background: #eff6ff;
}

.payment-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.05);
}

.order-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total {
    font-size: 1.4rem;
    font-weight: 800;
}

/* Success State */
.admin-toast {
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.admin-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.admin-toast i {
    color: var(--accent);
}

.success-content {
    text-align: center;
    padding: 40px 0;
}

.success-icon {
    margin-bottom: 24px;
}

.check-wrapper {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-size: 2.5rem;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
    animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.receipt-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 30px;
    text-align: left;
    box-shadow: var(--shadow);
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.receipt-row span:first-child {
    color: var(--text-muted);
}

.receipt-row .value {
    font-weight: 600;
}

hr {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 16px 0;
}

.receipt-students {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.receipt-student-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Loader Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay.active {
    display: flex;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--primary);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Custom Scrollbar */
.student-list::-webkit-scrollbar {
    width: 4px;
}
.student-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
