/**
 * जल गंगा संवर्धन योजना - Custom Styles
 */

/* ============ Variables ============ */
:root {
    --primary: #1a5f7a;
    --secondary: #57c5b6;
    --accent: #159895;
    --bg-main: #f4f7f9;
    --bg-card: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e74c3c;
    --border-color: #e0e6ed;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ============ Base ============ */
body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans Devanagari', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > .container {
    flex: 1;
}

/* Footer always at bottom */
footer {
    margin-top: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
}

/* ============ Cards ============ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

/* ============ Form Styles ============ */
.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-label small {
    color: var(--text-secondary);
    font-weight: 400;
}

/* Progress Steps - Clickable */
.progress-step {
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-step:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

.progress-step.active {
    transform: scale(1.05);
}

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(87, 197, 182, 0.15);
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--danger);
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.15rem;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    padding-left: 0.5rem;
}

/* ============ Buttons ============ */
.btn {
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

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

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

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

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

/* ============ Hero Section ============ */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 10 Q20 25 30 40 Q40 25 30 10' fill='none' stroke='rgba(255,255,255,0.1)' stroke-width='1'/%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

/* ============ Progress Steps ============ */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}

.progress-step .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin: 0 auto 0.5rem;
    transition: all 0.3s;
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background: var(--primary);
    color: white;
}

.progress-step.completed .step-number {
    background: var(--success);
}

.progress-step .step-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: none;
}

.progress-step.active .step-title {
    color: var(--primary);
    font-weight: 500;
}

@media (min-width: 768px) {
    .progress-step .step-title {
        display: block;
    }
}

/* ============ Section Card ============ */
.form-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.form-section h3 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--secondary);
}

.form-section h3 i {
    margin-right: 0.5rem;
}

/* ============ Category Checkboxes ============ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.category-item {
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.2s;
    cursor: pointer;
}

.category-item:hover {
    border-color: var(--secondary);
}

.category-item.selected {
    border-color: var(--primary);
    background: rgba(26, 95, 122, 0.05);
}

.category-item input[type="checkbox"] {
    display: none;
}

.category-item .form-check {
    margin: 0;
}

/* ============ Work Type Cards ============ */
.work-type-card {
    display: block;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.work-type-card:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.work-type-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(26, 95, 122, 0.08) 0%, rgba(87, 197, 182, 0.08) 100%);
}

.work-type-card input[type="checkbox"] {
    display: none;
}

.work-type-card .work-type-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.work-type-card .work-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.work-type-card .work-type-icon i {
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all 0.25s ease;
}

.work-type-card.selected .work-type-icon {
    background: var(--primary);
}

.work-type-card.selected .work-type-icon i {
    color: white;
}

.work-type-card .work-type-text {
    flex: 1;
    min-width: 0;
}

.work-type-card .work-type-text strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.work-type-card .work-type-text small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.work-type-card .btn-remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.work-type-card .btn-remove:hover {
    opacity: 1;
}

.work-type-card .btn-remove i {
    color: var(--danger);
    font-size: 1.25rem;
}

/* Support cards styling */
.support-card .work-type-icon {
    background: rgba(253, 203, 110, 0.2);
}

.support-card.selected .work-type-icon {
    background: #fdcb6e;
}

/* ============ Stats Cards ============ */
.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============ Table Styles ============ */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--bg-main);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: rgba(87, 197, 182, 0.05);
}

/* ============ Status Badges ============ */
.badge-status {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-pending {
    background: rgba(253, 203, 110, 0.2);
    color: #e67e22;
}

.badge-approved {
    background: rgba(0, 184, 148, 0.2);
    color: #00b894;
}

.badge-rejected {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* ============ Admin Sidebar ============ */
.admin-sidebar {
    background: var(--bg-card);
    min-height: 100vh;
    border-right: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0.25rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(87, 197, 182, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-menu a i {
    width: 24px;
    margin-right: 0.75rem;
}

/* ============ CAPTCHA ============ */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.captcha-display {
    background: var(--bg-main);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--primary);
    user-select: none;
}

.captcha-display span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============ File Upload ============ */
.file-upload-wrapper {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-main);
}

.file-upload-wrapper:hover {
    border-color: var(--secondary);
    background: rgba(87, 197, 182, 0.05);
}

.file-upload-wrapper i {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

/* ============ Success Page ============ */
.success-animation {
    text-align: center;
    padding: 3rem 0;
}

.success-animation .checkmark {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--success);
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease-out;
}

.success-animation .checkmark i {
    font-size: 3rem;
    color: white;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.registration-id-display {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin: 2rem 0;
}

.registration-id-display h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* ============ Charts Container ============ */
.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
}

/* ============ Pagination ============ */
.pagination {
    margin: 0;
}

.page-link {
    color: var(--primary);
    border-color: var(--border-color);
}

.page-link:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ============ Responsive Adjustments ============ */
@media (max-width: 768px) {
    .hero-section {
        padding: 2.5rem 0;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .form-section {
        padding: 1.5rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .admin-sidebar {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

/* ============ Utilities ============ */
.text-hindi {
    font-family: 'Noto Sans Devanagari', sans-serif;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.shadow-custom {
    box-shadow: var(--shadow);
}

.border-primary-light {
    border-color: var(--secondary) !important;
}

/* ============ Toast Notifications ============ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    animation: slideIn 0.3s ease-out;
}

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

/* ============ Login Page ============ */
.login-card {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

/* ============ Mobile Responsive Form ============ */
@media (max-width: 576px) {
    /* General padding */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Page Header */
    .page-header h1 {
        font-size: 1.25rem;
    }

    /* Progress Steps - Compact Scrollable */
    .progress-steps {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.25rem;
        padding-bottom: 0.5rem;
        scrollbar-width: thin;
    }

    .progress-steps::-webkit-scrollbar {
        height: 4px;
    }

    .progress-steps::-webkit-scrollbar-thumb {
        background: var(--secondary);
        border-radius: 2px;
    }

    .progress-steps::before {
        display: none;
    }

    .progress-step {
        flex: 0 0 auto;
        min-width: 50px;
        padding: 0.25rem;
    }

    .progress-step .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
        margin: 0 auto;
    }

    .progress-step .step-title {
        display: none;
    }

    /* Form Sections */
    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .form-section h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .form-section h3 i {
        margin-right: 0.25rem;
    }

    /* Form Grid */
    .form-section .row.g-3 > div,
    .form-section .row.g-2 > div {
        margin-bottom: 0.5rem;
    }

    /* Work Type Cards */
    .work-type-card {
        padding: 0.625rem;
        border-radius: 8px;
    }

    .work-type-card .work-type-icon {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    .work-type-card .work-type-icon i {
        font-size: 0.9rem;
    }

    .work-type-card .work-type-text {
        overflow: hidden;
    }

    .work-type-card .work-type-text strong {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .work-type-card .work-type-text small {
        font-size: 0.65rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    /* Navigation Buttons - Full Width Stack */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
        position: sticky;
        bottom: 0;
        background: var(--bg-main);
        padding: 1rem 0;
        z-index: 100;
    }

    .d-flex.justify-content-between .btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    #btnPrev, #btnNext, #btnSubmit {
        width: 100% !important;
        margin: 0 !important;
    }

    /* CAPTCHA - Compact */
    .captcha-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .captcha-display {
        font-size: 1.1rem;
        padding: 0.5rem 1rem;
    }

    .captcha-container input {
        max-width: 80px !important;
    }

    /* Summary and Sidebar - Stack on Mobile */
    #step-7 .row > div {
        width: 100%;
    }

    .sticky-top {
        position: static !important;
        margin-top: 1rem;
    }

    /* Form Inputs */
    .form-control,
    .form-select {
        font-size: 16px;
        padding: 0.625rem 0.75rem;
    }

    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }

    /* Custom Add Forms */
    .bg-light {
        padding: 0.75rem !important;
    }

    .bg-light h6 {
        font-size: 0.9rem;
    }

    /* Alert boxes */
    .alert {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
    }

    /* Badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

    /* Summary */
    #summary p {
        font-size: 0.85rem;
    }
}

/* Tablet */
@media (min-width: 577px) and (max-width: 768px) {
    .form-section .row.g-3 > div {
        margin-bottom: 0.75rem;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .progress-step .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .progress-step {
        min-width: 40px;
    }

    .form-section {
        padding: 0.75rem;
    }

    .form-section h3 {
        font-size: 0.9rem;
    }

    .form-section h3 i {
        margin-right: 0.15rem;
    }
}

/* ============ Footer Mobile Styles ============ */
@media (max-width: 576px) {
    footer {
        padding: 1.5rem 0 !important;
    }

    footer h5,
    footer h6 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    footer ul {
        margin-bottom: 1rem;
    }

    footer li {
        margin-bottom: 0.5rem !important;
    }

    footer a,
    footer li i + * {
        font-size: 0.85rem;
    }

    footer hr {
        margin: 1rem 0 !important;
    }

    footer small {
        font-size: 0.75rem;
    }

    .footer-brand {
        display: flex;
        align-items: center;
    }

    .footer-brand svg {
        width: 28px;
        height: 28px;
    }

    .footer-brand span {
        font-size: 0.95rem;
    }
}

/* Navbar Mobile */
@media (max-width: 576px) {
    .navbar-brand span {
        font-size: 0.9rem !important;
    }

    .navbar-brand small {
        font-size: 0.65rem !important;
    }

    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Toast Notification Mobile */
.auto-save-toast {
    left: 10px !important;
    right: 10px !important;
    bottom: 80px !important;
    text-align: center;
}
