/* Base styles that work for all devices */
html, body {
    height: auto; /* Change from 100% to auto */
    min-height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: "Century Gothic", "Segoe UI", "Noto Sans Bengali", "Hind Siliguri", "SolaimanLipi", Roboto, sans-serif;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Responsive typography */
html {
    font-size: 16px;
}

/* Layout components */
header {
    height: auto;
    min-height: 64px;
    flex-shrink: 0;
    background-color: #f5f7fa;
    border-bottom: 1px solid #dee2e6;
    z-index: 1000;
    padding: 0 1rem;
}

footer {
    height: auto;
    padding: 1rem;
    flex-shrink: 1;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    z-index: 1000;
}

main {
    flex: 1 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem;
    -webkit-overflow-scrolling: touch;
}

.content-wrapper {
    margin-bottom: 1rem;
}

.container {
    width: 100%;
    max-width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
    padding-bottom: 1.25rem;
}


/* Interactive elements */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* DataTables adjustments */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.375rem;
    border: 1px solid #ccc;
    padding: 0.375rem 0.75rem;
    background-color: #fff;
    font-family: "Century Gothic", "Segoe UI", sans-serif;
    max-width: 100%;
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        margin: 0.25rem;
        padding: 0.4rem 0.75rem;
        border-radius: 0.375rem;
        border: 1px solid #dee2e6;
        background-color: #fff;
        color: #0d6efd;
        font-weight: 500;
        transition: all 0.15s ease-in-out;
        min-width: 2.5rem;
        text-align: center;
    }

        .dataTables_wrapper .dataTables_paginate .paginate_button.current {
            background-color: #0d6efd;
            color: #fff !important;
            border-color: #0d6efd;
        }

/* Theme variables */
:root {
    --primary-color: #4e73df;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --secondary-color: #858796;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
}

/* Card styles */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    padding: 1rem;
}

.page-title {
    color: var(--dark-color);
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Countdown styles */
.countdown-box {
    background-color: white;
    min-width: 70px;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 0.5rem;
    margin: 0.25rem;
    text-align: center;
}

    .countdown-box div {
        font-size: 1.5rem;
        font-weight: 600;
        line-height: 1.2;
    }

    .countdown-box p {
        margin-bottom: 0;
        font-size: 0.75rem;
        color: var(--secondary-color);
    }

/* Chart container */
.chart-container {
    position: relative;
    height: auto;
    min-height: 250px;
    width: 100%;
}

/* Status badges */
.status-badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    display: inline-block;
}

.status-sent {
    color: var(--primary-color);
    background-color: rgba(78, 115, 223, 0.1);
}

.status-viewed {
    color: var(--info-color);
    background-color: rgba(54, 185, 204, 0.1);
}

.status-inprogress {
    color: var(--warning-color);
    background-color: rgba(246, 194, 62, 0.1);
}

.status-completed {
    color: var(--success-color);
    background-color: rgba(28, 200, 138, 0.1);
}

.status-expired {
    color: var(--secondary-color);
    background-color: rgba(133, 135, 150, 0.1);
}

/* Action links */
.action-link {
    margin: 0 0.25rem;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: inline-block;
}

    .action-link:hover {
        transform: scale(1.1);
    }

/* Stat cards */
.stat-card {
    border-left: 0.25rem solid;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    padding: 1rem;
}

    .stat-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    }

.stat-card-primary {
    border-left-color: var(--primary-color);
}

.stat-card-warning {
    border-left-color: var(--warning-color);
}

.stat-card h5 {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.stat-card h1 {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 1.75rem;
    margin-bottom: 0;
}

/* Table card */
.table-card {
    border-radius: 0.5rem;
    overflow: hidden;
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    html {
        font-size: 14px;
    }

    main {
        padding: 0.75rem;
    }

    .card-header {
        padding: 0.75rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
        margin-bottom: 0.5rem;
    }

        .dataTables_wrapper .dataTables_length select,
        .dataTables_wrapper .dataTables_filter input {
            width: 100%;
        }

    .dataTables_wrapper .dataTables_paginate {
        justify-content: center;
    }

    .countdown-box {
        min-width: 60px;
        padding: 0.25rem;
    }

        .countdown-box div {
            font-size: 1.25rem;
        }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
    html {
        font-size: 15px;
    }

    .container {
        max-width: 95%;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
    }
}

/* Foldable device support */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }

    .stat-card h1 {
        font-size: 1.5rem;
    }

    .action-link {
        margin: 0 0.15rem;
        font-size: 1rem;
    }
}

/* Orientation-specific adjustments */
@media screen and (orientation: portrait) {
    .chart-container {
        height: 250px;
    }
}

@media screen and (orientation: landscape) {
    .chart-container {
        height: 300px;
    }
}

/* Very large screens */
@media (min-width: 1600px) {
    .container {
        max-width: 1500px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        box-shadow: 0 0.075rem 0.875rem 0 rgba(58, 59, 69, 0.1);
    }
}

/* Print styles */
@media print {
    body {
        background-color: #fff;
    }

    header, footer {
        display: none;
    }

    main {
        padding: 0;
        overflow: visible;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
