/* Snatak College Islampur - Custom Premium Styling */

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

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary-color: #06b6d4;
    --secondary-hover: #0891b2;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-muted: #64748b;
    --bg-gradient: linear-gradient(135deg, #eef2f6 0%, #e2e8f0 100%);
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 20px 40px -10px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
}

img, svg {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--dark-color);
    min-height: 100vh;
    padding-bottom: 3rem;
}

/* Header & Logo styling */
.header-section {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 2.5rem;
}

.logo-img {
    height: 70px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.logo-img:hover {
    transform: scale(1.05);
}

.college-title {
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Main Container Card */
.main-card {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Card Header */
.card-header-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: 2rem;
    border-bottom: none;
}

@media screen and (max-width: 992px) {
    .header-section .container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-section .d-flex.gap-2 {
        width: 100%;
        justify-content: flex-start;
        gap: 0.75rem;
    }

    .header-section .btn {
        width: auto;
        flex: 1 1 auto;
    }

    .card-body {
        padding: 1.5rem !important;
    }
}

@media screen and (max-width: 768px) {
    .header-section {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .header-section .container {
        flex-direction: column;
        align-items: stretch;
    }

    .header-section .d-flex.gap-2 {
        justify-content: center;
    }

    .header-section .college-title {
        font-size: 1.4rem;
    }

    .wizard-steps {
        flex-wrap: wrap;
        justify-content: center;
        margin: 1rem 0 2rem 0;
        padding: 0;
    }

    .step-item {
        width: 50%;
        margin-bottom: 0.75rem;
    }

    .step-circle {
        width: 40px;
        height: 40px;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .form-control,
    .form-select,
    .custom-file-upload {
        font-size: 0.95rem;
    }
}

@media screen and (max-width: 576px) {
    .header-section .container {
        align-items: center;
        text-align: center;
    }

    .header-section .d-flex.gap-2 {
        flex-direction: column;
        width: 100%;
    }

    .header-section .btn {
        width: 100%;
    }

    .card-header-gradient {
        padding: 1.5rem 1rem;
    }

    .wizard-steps {
        margin: 1rem 0 1.5rem 0;
    }

    .step-item {
        width: 100%;
    }

    .step-label {
        display: none;
    }

    .form-section-title {
        font-size: 1rem;
    }

    .form-control,
    .form-select {
        padding: 0.75rem;
    }
}

/* Form Wizard Stepper */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 1.5rem 0 3rem 0;
    padding: 0 1rem;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--border-color);
    z-index: 1;
    transform: translateY(-50%);
}

.wizard-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 3px;
    background-color: var(--primary-color);
    z-index: 2;
    transform: translateY(-50%);
    transition: width 0.4s ease;
    width: 0%;
}

.step-item {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 25%;
}

.step-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #fff;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.step-label {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    text-align: center;
}

.step-item.active .step-circle {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-light);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.3);
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: 700;
}

.step-item.completed .step-circle {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.step-item.completed .step-label {
    color: var(--dark-color);
}

/* Form Control Styling */
.form-section-title {
    font-weight: 700;
    color: var(--dark-color);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.form-section-title i {
    color: var(--primary-color);
    margin-right: 0.75rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--dark-color);
    background-color: #fff;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    outline: none;
}

/* Custom File Upload Styling */
.custom-file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    background-color: var(--light-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.custom-file-upload:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.custom-file-upload i {
    font-size: 1.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.custom-file-upload:hover i {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-preview-name {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    word-break: break-all;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
}

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

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background-color: var(--light-color);
    border-color: var(--text-muted);
    color: var(--dark-color);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Optional Qualifications Toggles */
.optional-header {
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.optional-header:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
}

.optional-header h5 {
    margin-bottom: 0;
    font-weight: 600;
    font-size: 1rem;
}

.optional-header .badge {
    background-color: var(--text-muted);
    font-weight: 500;
}

/* Printable Application Summary */
.print-summary {
    padding: 2rem;
    background-color: #f8fafc;
    color: #111827;
}

.print-card {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 18px;
    padding: 2rem;
    background-color: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.resume-header {
    display: grid;
    grid-template-columns: minmax(100px, 140px) 1fr minmax(180px, 240px);
    gap: 1.5rem;
    align-items: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1.25rem;
    margin-bottom: 1.75rem;
}

.profile-photo-box {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 20px;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.18);
}

.profile-initials {
    width: 140px;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.18);
}

.resume-title h1 {
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.resume-title p {
    margin-bottom: 0.25rem;
}

.resume-contact p {
    margin-bottom: 0.35rem;
}

@media screen and (max-width: 768px) {
    .resume-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .resume-contact {
        text-align: center !important;
    }
}

.resume-header h1 {
    margin: 0;
    font-size: 2.25rem;
    letter-spacing: -0.03em;
}

.resume-header p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 1rem;
}

.resume-contact p {
    margin: 0.35rem 0;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.resume-section {
    margin-bottom: 1.75rem;
}

.resume-section h2 {
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    color: var(--primary-color);
}

.resume-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resume-item {
    background: #f8fafc;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    border: 1px solid #e2e8f0;
}

.resume-item h3 {
    margin-top: 0;
    margin-bottom: 0.85rem;
    font-size: 1rem;
    color: var(--dark-color);
}

.resume-item p,
.education-row p,
.print-row p {
    margin: 0.45rem 0;
    line-height: 1.5;
}

.education-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
}

.education-table thead {
    background-color: rgba(79, 70, 229, 0.08);
}

.education-table th,
.education-table td {
    padding: 1rem 0.9rem;
    color: var(--dark-color);
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.education-table th {
    font-weight: 700;
    color: var(--primary-color);
    text-align: left;
}

.education-table tbody tr:last-child td {
    border-bottom: none;
}

.resume-section p {
    color: var(--dark-color);
}

@media screen and (max-width: 768px) {
    .education-table th,
    .education-table td {
        padding: 0.75rem 0.65rem;
    }
}
@media screen and (max-width: 768px) {
    .resume-header,
    .resume-grid,
    .education-row {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    html, body {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
        font-size: 11pt;
        line-height: 1.2;
        color: #000;
        background: #fff;
    }

    body.reprint-print * {
        visibility: hidden;
    }

    body.reprint-print #printSummary,
    body.reprint-print #printSummary * {
        visibility: visible;
    }

    body.reprint-print #printSummary {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 0;
        background: #fff;
    }

    body.reprint-print .print-card {
        box-shadow: none;
        border: none;
        margin: 0;
        padding: 1.25rem;
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    .resume-header {
        display: grid;
        grid-template-columns: minmax(100px, 140px) 1fr minmax(180px, 240px);
        gap: 1rem;
        align-items: center;
        margin-bottom: 1rem;
    }

    .profile-photo,
    .profile-initials {
        width: 90px !important;
        height: 90px !important;
        border-width: 3px !important;
        box-shadow: none !important;
    }

    .resume-title h1 {
        font-size: 18px;
        margin-bottom: 0.3rem;
    }

    .resume-title p,
    .resume-contact p,
    .resume-section h2 {
        margin-bottom: 0.25rem;
    }

    .resume-contact,
    .resume-title,
    .profile-photo-box {
        text-align: initial !important;
    }

    .resume-section {
        margin-bottom: 1rem;
    }

    .resume-section h2 {
        font-size: 14px;
        margin-bottom: 0.45rem;
        padding-bottom: 0.35rem;
    }

    .resume-item,
    .education-table th,
    .education-table td {
        border: 1px solid #d1d5db !important;
    }

    .education-table th,
    .education-table td {
        padding: 0.65rem 0.7rem !important;
        font-size: 11px;
        white-space: normal !important;
        word-break: break-word;
    }

    .education-table thead {
        background-color: #eef2ff !important;
    }

    .education-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .resume-grid {
        display: grid;
        gap: 1rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .resume-item {
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        padding: 1rem 1.25rem !important;
        margin-bottom: 0.75rem;
    }

    .resume-item h3 {
        font-size: 12px;
        margin-bottom: 0.25rem;
    }

    .resume-item p {
        margin: 0.2rem 0;
    }

    .print-card,
    .resume-section,
    .education-table,
    .resume-item,
    .print-header {
        page-break-inside: avoid;
    }

    button,
    .btn,
    .navbar,
    .search-form,
    .alert,
    .d-print-none {
        display: none !important;
    }
}

/* Admin Dashboard CSS */
.admin-card {
    background-color: #fff;
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.admin-header {
    background: linear-gradient(135deg, var(--dark-color) 0%, #334155 100%);
    color: #fff;
    padding: 1.5rem;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.admin-stats-box {
    background-color: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.admin-stats-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
}

.stats-icon {
    font-size: 2.25rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.status-badge {
    padding: 0.35em 0.65em;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 30px;
}

.status-pending {
    background-color: #fef3c7;
    color: #d97706;
}

.status-shortlisted {
    background-color: #d1fae5;
    color: #059669;
}

.status-rejected {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Search bar styling */
.search-wrapper {
    position: relative;
}

.search-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-wrapper .form-control {
    padding-left: 2.5rem;
}

/* Custom transitions and animations */
.fade-step {
    display: none;
}

.fade-step.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Card styling */
.login-card {
    border: none;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Mobile-first responsive adjustments */
/* Make images scale nicely and reduce fixed heights for small screens */
.logo-img {
    max-height: 70px;
    height: auto;
    width: auto;
}

@media (max-width: 575.98px) {
    .header-section .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .college-title {
        font-size: 1rem;
    }
}

/* Small-screen header and logo fixes to avoid layout shift/overflow */
@media (max-width: 575.98px) {
    .header-section .container {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
        gap: 0.75rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .header-section .container > .d-flex {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .header-section .container > div:last-child {
        align-self: stretch;
        width: 100%;
    }

    .college-title {
        font-size: 1rem;
        text-align: left;
    }

    .header-section .logo-img {
        max-height: 60px;
        height: auto !important;
        margin-bottom: 0.25rem;
    }

    /* Override inline height used in admin_login.php image */
    .login-card .logo-img {
        max-height: 60px;
        height: auto !important;
        width: auto !important;
    }

    /* Prevent horizontal scrolling caused by unexpected widths */
    html,
    body {
        overflow-x: hidden;
    }

    /* Slightly reduce horizontal padding for the main container on small screens */
    .container.my-4 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Improve login card layout on small screens */
@media (max-width: 575.98px) {
    .login-card {
        padding: 1.25rem 1rem;
    }

    .login-card .logo-img {
        max-width: 180px;
        width: 70%;
        height: auto !important;
        display: block;
        margin: 0.25rem auto 0.6rem auto;
        object-fit: contain;
    }

    .login-card .bg-primary {
        width: auto;
    }

    .login-card h3 {
        font-size: 1.25rem;
    }
}

/* Improve form/card spacing on small devices */
.main-card {
    margin: 0;
}

@media (min-width: 576px) {
    .main-card {
        margin: 0 0.5rem;
    }
}

.card-body {
    padding: 1rem;
}

.card-header-gradient {
    padding: 1.25rem;
}

.wizard-steps {
    /* Keep steps on a single line by default; allow scrolling on very small screens */
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.step-item {
    width: auto;
    flex: 0 0 auto;
    min-width: 64px;
    text-align: center;
}

.step-label {
    display: block;
    font-size: 0.85rem;
}

.step-circle {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
}

.form-control, .form-select {
    font-size: 0.95rem;
    padding: 0.6rem 0.9rem;
}

.custom-file-upload {
    padding: 1rem;
}

/* Make action buttons full width on small screens */
.wizard-footer-mobile {
    display: none;
}

/* Hide native scrollbar for a cleaner look */
.wizard-steps::-webkit-scrollbar {
    height: 6px;
}
.wizard-steps::-webkit-scrollbar-track {
    background: transparent;
}
.wizard-steps::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.08);
    border-radius: 10px;
}

/* Stack wizard footer actions on small screens */
.d-flex.justify-content-between.mt-5.pt-3.border-top {
    flex-direction: column;
    gap: 0.6rem;
}

/* Medium devices and up (tablets) */
@media (min-width: 576px) {
    .step-label {
        display: block;
        font-size: 0.9rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .main-card {
        margin: 0;
    }
}

/* Ensure steps remain in one row on very small screens and shrink labels slightly */
@media (max-width: 575.98px) {
    .wizard-steps {
        padding: 0 0.6rem;
    }

    .step-item {
        min-width: 70px;
        margin-right: 0.5rem;
    }

    .step-label {
        font-size: 0.72rem;
        white-space: normal;
    }

    .wizard-steps::before {
        left: 0;
    }
}

/* Desktop and large screens */
@media (min-width: 992px) {
    .logo-img {
        max-height: 70px;
    }

    .wizard-steps {
        padding: 0 1rem;
    }

    .step-item {
        width: 25%;
        flex: 0 0 25%;
    }

    .step-label {
        display: block;
    }

    .card-body {
        padding: 2rem 2.5rem;
    }
}

/* Accessibility tweak: ensure file previews wrap on small screens */
.file-preview-name {
    word-wrap: break-word;
    white-space: normal;
}

