@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #012cfd;
    --primary-dark: #0d39e0;
    --secondary: #f0f7ff;
    --accent: #00d2ff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --text-main: #333;
    --text-muted: #666;
    --bg-light: #f4f7fa;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 40px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 0 0 30px;
    text-align: center;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0;
    margin-bottom: 5px;
    display: block;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

header p {
    font-size: 0.9rem;
    opacity: 0.9;
    padding: 0 20px;
}

/* Container */
.container {
    padding: 0 20px;
    margin-top: -30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Course Card */
.course-grid {
    display: grid;
    gap: 20px;
    padding-bottom: 30px;
}

.course-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    /* Horizontal layout */
    align-items: center;
    padding: 15px;
    gap: 15px;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.course-img {
    width: 125px;
    height: 125px;
    object-fit: cover;
    border-radius: 15px;
    /* Rounded corners on the image as requested */
    flex-shrink: 0;
}

.course-content {
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-card h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 5px;
    font-weight: 700;
}

.course-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
}

.course-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    width: fit-content;
    text-transform: uppercase;
}

.btn-enroll {
    margin-top: 5px;
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    transition: filter 0.2s;
    width: fit-content;
    min-width: 120px;
}

.course-card.disabled {
    filter: grayscale(0.5);
    opacity: 0.8;
}

.course-card.disabled .btn-enroll {
    background: #ccc;
    cursor: not-allowed;
}

.status-open {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-closed {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

/* Modals / Overlays */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: flex-end;
    /* Mobile style, slide from bottom */
    z-index: 1000;
}

.modal {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    padding: 30px 20px;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--primary);
}

/* Result Section */
#resultContent {
    text-align: center;
}

.voucher-preview {
    background: #fdfdfd;
    border: 2px dashed #ddd;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
}

/* Admin Dashboard Styling */
.admin-table-container {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow-x: auto;
    box-shadow: var(--shadow);
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-muted);
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

/* Responsive adjustments for Desktop */
@media (min-width: 768px) {
    header {
        padding: 10px 10px 50px;
    }

    .header-logo {
        max-width: 550px;
        border-radius: 10px;
    }

    header p {
        padding: 0;
    }

    .container {
        margin-top: -20px;
    }

    .modal {
        border-radius: 20px;
        align-self: center;
        /* Center on desktop */
        animation: fadeIn 0.3s;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: scale(0.9);
        }

        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    .overlay {
        align-items: center;
    }
}