﻿/* 1. General & Container Styles */
.container {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    max-width: 1150px;
}

.registration-container {
    max-width: 800px;
    margin: 40px auto;
}

.title-blue {
    color: #1a237e;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* 2. Card Styling */
.custom-card {
    background: #ffffff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
    width: 100%;
}

.card-header-blue {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: white;
    padding: 1.5rem;
}

    .card-header-blue h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
    }

/* 3. Form Elements */
.form-label {
    font-weight: 600;
    color: #455a64;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    display: block;
    width: 100% !important;
    padding: 0.75rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.form-select {
    appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
}

    .form-control:focus, .form-select:focus {
        border-color: #1e88e5;
        box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15);
        outline: none;
    }

/* 4. Table & List Styling */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
}

.custom-table {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
}

    .custom-table thead th {
        background-color: #f8f9fa;
        color: #546e7a;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        padding: 1.2rem;
        border-bottom: 2px solid #eceff1;
    }

    .custom-table tbody td {
        padding: 1rem 1.2rem;
        vertical-align: middle;
    }

/* 5. All Buttons Styling */

/* Add Student Button */
.btn-add-student {
    background-color: #007bff !important;
    color: white !important;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none !important;
    border: none;
    display: inline-block;
    transition: 0.3s;
}

    .btn-add-student:hover {
        background-color: #0056b3 !important;
        transform: translateY(-1px);
    }

/* Form Submit Button */
.btn-submit-blue {
    background-color: #1e88e5;
    color: white;
    padding: 0.7rem 2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
}

/* Table Action Buttons */
.btn-view {
    background-color: #00bcd4 !important;
    color: white !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 0.85rem !important;
    display: inline-block;
}

.btn-edit {
    background-color: #ffc107 !important;
    color: black !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 0.85rem !important;
    display: inline-block;
}

.btn-delete {
    background-color: #dc3545 !important;
    color: white !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    display: inline-block;
}

.btn-cancel {
    background-color: #f1f3f5 !important;
    color: #495057 !important;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    border: 1px solid #ced4da !important;
    text-decoration: none !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

/* 6. Spacing & Photo Upload */
.custom-card .card-body {
    padding: 2.5rem !important;
}

.registration-container .row {
    margin-right: 0;
    margin-left: 0;
    column-gap: 20px;
}

/* --- 6. Spacing & Photo Upload (Updated) --- */
.image-preview-box {
    width: 150px; /* Aapki layout ke hisaab se fixed width */
    height: 180px; /* Passport size ratio */
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f8f9fa;
    margin-bottom: 10px;
}

    .image-preview-box img {
        width: 100% !important;
        height: 100% !important;
        object-fit: fill !important; /* Isse image box ke kono tak khinch jayegi */
        display: block;
    }

/* View Page ke liye extra styling - Bina box wali photo */
.student-photo-view {
    width: 160px;
    height: 180px;
    border-radius: 8px;
    object-fit: cover;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .custom-card {
        width: 98% !important;
        margin: 0 auto !important;
    }

    .table-responsive {
        overflow-x: hidden !important;
        display: block !important;
    }

    /* 2. Table Layout Fix */
    .custom-table {
        font-size: 10px !important;
        width: 100% !important;
        table-layout: auto !important;
    }

        .custom-table thead th,
        .custom-table tbody td {
            padding: 8px 3px !important;
            text-align: center !important;
        }

    .action-buttons-container,
    .d-flex.justify-content-center.gap-2 {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 3px !important;
    }

    .btn-view, .btn-edit, .btn-delete {
        padding: 4px 5px !important;
        font-size: 9px !important;
        white-space: nowrap !important;
        display: inline-block !important;
        width: auto !important;
        border-radius: 4px !important;
    }

    .custom-table td:nth-child(2) {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto !important;
        display: block !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        margin: 0 auto !important;
        width: 100% !important;
        border-radius: 8px;
    }

    .custom-table {
        font-size: 11px !important;
        width: 100% !important;
        min-width: 600px;
    }

        .custom-table thead th,
        .custom-table tbody td {
            padding: 10px 8px !important;
            white-space: nowrap !important;
            text-align: center !important;
        }

    /* 3. Horizontal Buttons */
    .d-flex.justify-content-center.gap-2 {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        justify-content: center !important;
    }

    .btn-view, .btn-edit, .btn-delete {
        padding: 4px 8px !important;
        font-size: 10px !important;
        display: inline-block !important;
        width: auto !important;
    }

    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* Next button jab disabled ho (Grey color) */
.btn-disabled {
    background-color: #e0e0e0 !important;
    color: #9e9e9e !important;
    padding: 0.7rem 2.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: not-allowed;
    min-width: 180px;
}

/* Blue Button (Same as your old one) */
.btn-submit-blue {
    background-color: #1e88e5 !important;
    color: white !important;
    padding: 0.7rem 2.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    transition: 0.3s;
    min-width: 180px;
}

/* Layout Adjustment for Side-by-side */
.registration-container {
    max-width: 950px;
}

.image-preview-box {
    width: 150px;
    height: 170px;
    border: 2px dashed #ccc;
}
