/* ================================================
   style.css
   ------------------------------------------------
   Global stylesheet for the Registration Form System.
   Design: Teal & White theme with smooth transitions
   and hover effects.
   ================================================ */

/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* --- CSS Reset & Root Variables --- */

:root {
    --teal:        #FDB913;   /* Gold */
    --teal-dark:   #E6A700;   /* Dark Gold */
    --teal-light:  #FFF8E1;   /* Light Gold */
    --white:       #FFFFFF;
    --gray-light:  #F4F4F4;
    --gray-border: #DDDDDD;
    --gray-text:   #888888;
    --dark:        #2C2C2C;
    --red:         #E74C3C;
    --green:       #27AE60;
    --shadow:      0 4px 20px rgba(0, 0, 0, 0.10);
}

/* --- Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Include padding/border in element size */
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--gray-light);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Page Wrapper --- */
.page-wrapper {
    width: 100%;
    max-width: 520px;
    padding: 30px 15px 60px;
}

/* --- Card Container --- */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* --- Card Top Teal Bar --- */
.card-topbar {
    height: 6px;
    background: var(--teal);
    width: 100%;
}

/* --- Card Body Padding --- */
.card-body {
    padding: 32px 36px;
}

/* --- Page / Form Title --- */
.card-title {
    font-size: 1.55rem;
    font-weight: 700;
    text-align: center;
    color: var(--dark);
    margin-bottom: 26px;
    line-height: 1.3;
}

/* --- Input Group (icon + input) --- */
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-border);
    border-radius: 5px;
    background: var(--white);
    margin-bottom: 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

/* Highlight input group on focus */
.input-group:focus-within {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(253, 185, 19, 0.20);
}

/* --- Icon inside input group --- */
.input-group .icon {
    padding: 0 12px;
    color: var(--gray-text);
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* --- Show / Hide password toggle button --- */
.password-toggle {
    background: transparent;    /* No background — blends into the input group */
    border: none;               /* No border */
    outline: none;
    padding: 0 12px;
    cursor: pointer;
    color: var(--gray-text);    /* Muted grey by default */
    font-size: 0.9rem;
    flex-shrink: 0;
    /* Smooth colour transition on hover */
    transition: color 0.2s ease;
}

/* Highlight the eye icon in teal when hovered */
.password-toggle:hover {
    color: var(--teal);
}

/* --- Text / Email / Password inputs --- */
.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="password"],
.input-group input[type="date"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 12px 12px 0;
    font-size: 0.92rem;
    font-family: 'Poppins', sans-serif;
    color: var(--dark);
    background: transparent;
}

/* --- Inline row (two inputs side by side) --- */
.input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 0; /* managed by children */
}

.input-row .input-group {
    flex: 1;
}

/* --- Select Dropdown --- */
.select-group {
    border: 1px solid var(--gray-border);
    border-radius: 5px;
    background: var(--white);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.select-group:focus-within {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(253, 185, 19, 0.20);
}

.select-group select {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 14px;
    font-size: 0.92rem;
    font-family: 'Poppins', sans-serif;
    color: var(--gray-text);
    background: transparent;
    cursor: pointer;
    appearance: none; /* Remove browser default arrow */
    -webkit-appearance: none;
}

/* Give selected option a darker color */
.select-group select.selected {
    color: var(--dark);
}

/* Custom dropdown arrow using UTF-8 character */
.select-group::after {
    content: '▼';
    font-size: 0.7rem;
    color: var(--gray-text);
    padding-right: 14px;
    pointer-events: none;
}

/* --- Radio Buttons (Gender) --- */
.radio-group {
    display: flex;
    gap: 24px;
    margin-bottom: 14px;
    padding: 4px 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--dark);
}

/* Style the radio circle */
.radio-group input[type="radio"] {
    accent-color: var(--teal); /* Teal fill when selected */
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* --- Checkboxes --- */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    color: var(--dark);
}

.checkbox-group input[type="checkbox"] {
    accent-color: var(--teal); /* Teal fill when checked */
    width: 15px;
    height: 15px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

/* --- Submit / Action Button --- */
.btn {
    display: block;
    width: 100%;
    padding: 13px;
    background: var(--teal);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    margin-top: 20px;
    letter-spacing: 0.5px;
    /* Smooth color transition on hover */
    transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}

.btn:hover {
    background: var(--teal-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(253, 185, 19, 0.35);
}

.btn:active {
    transform: translateY(0);
}

/* --- Secondary / Outline Button --- */
.btn-outline {
    background: transparent;
    color: var(--teal);
    border: 2px solid var(--teal);
}

.btn-outline:hover {
    background: var(--teal-light);
    box-shadow: none;
}

/* --- Danger Button (Delete) --- */
.btn-danger {
    background: var(--red);
}

.btn-danger:hover {
    background: #c0392b;
    box-shadow: 0 6px 18px rgba(231, 76, 60, 0.35);
}

/* --- Inline Button Row --- */
.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-row .btn {
    margin-top: 0;
}

/* --- Alert / Flash Messages --- */
.alert {
    padding: 12px 16px;
    border-radius: 5px;
    margin-bottom: 18px;
    font-size: 0.88rem;
    font-weight: 500;
}

.alert-error {
    background: #fdecea;
    color: var(--red);
    border-left: 4px solid var(--red);
}

.alert-success {
    background: #eafaf1;
    color: var(--green);
    border-left: 4px solid var(--green);
}

/* --- Validation error text under a field --- */
.field-error {
    color: var(--red);
    font-size: 0.78rem;
    margin-top: -10px;
    margin-bottom: 10px;
    display: block;
}

/* --- Label above a field --- */
.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-text);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Footer / Developer credit --- */
.footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--gray-text);
}

.footer a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* ==============================================
   RECORDS TABLE (index.php)
   ============================================== */

/* --- Table wrapper for horizontal scroll on mobile --- */
.table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
}

/* --- Data Table --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th {
    background: var(--teal);
    color: var(--white);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--gray-border);
    white-space: nowrap;
    color: var(--dark);
}

/* Alternating row background for readability */
.data-table tbody tr:nth-child(even) {
    background: var(--teal-light);
}

/* Hover highlight on table rows */
.data-table tbody tr:hover {
    background: #d3ca23;
    transition: background 0.2s ease;
}

/* --- Small action buttons inside the table --- */
.btn-sm {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-family: 'Poppins', sans-serif;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.btn-sm:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* --- Edit button (teal) --- */
.btn-edit {
    background: var(--teal);
    color: var(--white);
}

/* --- Delete button (red) --- */
.btn-delete {
    background: var(--red);
    color: var(--white);
}

/* --- Empty state message --- */
.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--gray-text);
    font-size: 0.95rem;
}

/* --- Top action bar above table --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}

.top-bar h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

/* --- Page title for wide pages --- */
.page-title-section {
    padding: 22px 36px 0;
}

/* ==============================================
   RESPONSIVE — Mobile adjustments
   ============================================== */
@media (max-width: 540px) {
    /* Stack the two-column name row vertically on small screens */
    .input-row {
        flex-direction: column;
        gap: 0;
    }

    .card-body {
        padding: 24px 20px;
    }

    .page-wrapper {
        padding: 16px 10px 50px;
    }

    .btn-row {
        flex-direction: column;
    }
}
