
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8f9fa;
}

.main-content {
    flex: 1;
    padding: 15px;
}

footer {
    background: #f8f9fa;
    text-align: center;
    padding: 10px 0;
    margin-top: auto; 
    width: 100%;
}

body.sport-bg {
    background: url('bg_sport.jpg') no-repeat center center fixed;
    background-size: cover;
    position: relative;
}

body.sport-bg::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(34, 49, 63, 0.7); 
    z-index: 0;
}

.card-login {
    background: rgba(255,255,255,0.92);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 2rem 2.5rem;
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(90deg, #00c853 0%, #2196f3 100%);
    border: none;
    font-weight: bold;
    letter-spacing: 1px;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #2196f3 0%, #00c853 100%);
}

h3.title-login {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #2196f3;
    text-align: center;
}

a {
    color: #00c853;
    font-weight: 500;
}

a:hover {
    color: #2196f3;
    text-decoration: underline;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet dan device menengah (768px - 991px) */
@media (max-width: 991px) {
    .main-content {
        padding: 12px;
    }
    
    .card-login {
        padding: 1.5rem 2rem;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Atur tabel agar scrollable */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 14px;
    }
    
    .card-rekomendasi {
        padding: 1.5rem 1rem;
        margin: 20px auto;
    }
}


/* Mobile landscape (576px - 767px) */
@media (max-width: 767px) {
    .main-content {
        padding: 10px;
    }
    
    .card-login {
        padding: 1.5rem 1.5rem;
        border-radius: 12px;
    }
    
    h3.title-login {
        font-size: 1.5rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav {
        margin-top: 10px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group > .btn {
        margin-bottom: 5px;
        width: 100%;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        font-size: 16px; 
        padding: 0.75rem; 
        height: auto;
        min-height: 48px; 
    }
    
    select.form-control {
        font-size: 16px !important;
        padding: 0.75rem !important;
        height: auto !important;
        min-height: 48px !important;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232196f3' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 12px;
        padding-right: 2.5rem !important;
    }
    
    select.form-control option {
        font-size: 16px;
        padding: 10px;
        line-height: 1.5;
    }
    
    input.form-control {
        font-size: 16px !important;
        padding: 0.75rem !important;
        height: auto !important;
        min-height: 48px !important;
    }
    
    label {
        font-size: 15px;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .form-text {
        font-size: 13px;
        line-height: 1.4;
        margin-top: 0.4rem;
    }
    
    .card-kuesioner {
        padding: 1.5rem 1rem;
        margin: 15px 10px;
    }
    
    h2.title-kuesioner {
        font-size: 1.5rem;
    }
    
    .alert {
        padding: 0.75rem;
        font-size: 14px;
    }
    
    .alert small {
        font-size: 13px;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #dee2e6;
        border-radius: 8px;
    }
    
    .table-responsive table {
        min-width: 800px; 
        margin-bottom: 0;
    }
    
    table {
        font-size: 12px;
        white-space: nowrap; 
    }
    
    table th, table td {
        padding: 0.5rem;
        min-width: 100px; 
    }
    
    .table-responsive table thead th:first-child,
    .table-responsive table tbody td:first-child {
        position: sticky;
        left: 0;
        background: white;
        z-index: 2;
    }
    
    .table-responsive table thead th:first-child {
        z-index: 3;
    }
    
    footer {
        padding: 15px 10px;
        font-size: 14px;
    }
    
    .card-rekomendasi {
        padding: 1.5rem 1rem;
        margin: 15px 10px;
    }
    
    h2.title-rekomendasi {
        font-size: 1.5rem;
    }
    
    .user-info table {
        font-size: 13px;
    }
    
    .user-info td {
        padding: 0.3rem !important;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
        margin-bottom: 10px;
        width: 100%;
    }
}

/* Mobile portrait (max 575px) */
@media (max-width: 575px) {
    .main-content {
        padding: 8px;
    }
    
    .card-login {
        padding: 1.25rem 1rem;
        border-radius: 10px;
    }
    
    h3.title-login {
        font-size: 1.3rem;
    }
    
    h1, .h1 {
        font-size: 1.75rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    h3, .h3 {
        font-size: 1.25rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
        font-size: 15px;
        padding: 0.75rem 1rem;
        min-height: 48px;
    }
    
    .btn-group-vertical > .btn {
        width: 100%;
    }
    
    input, select, textarea {
        width: 100%;
        font-size: 16px !important; 
        min-height: 48px !important;
    }
    
    select.form-control {
        font-size: 16px !important;
        padding: 0.75rem 2.5rem 0.75rem 0.75rem !important;
        line-height: 1.5;
        word-wrap: break-word;
    }
    
    select.form-control option {
        font-size: 16px;
        padding: 12px 8px;
        white-space: normal; 
        word-wrap: break-word;
    }
    
    label {
        font-size: 14px;
        font-weight: 600;
    }
    
    .form-text {
        font-size: 12px;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    body.sport-bg {
        background-attachment: scroll;
        background-position: center;
    }
    
    .card-kuesioner {
        padding: 1rem 0.75rem;
        margin: 10px 5px;
    }
    
    h2.title-kuesioner {
        font-size: 1.3rem;
    }
    
    .card-rekomendasi {
        padding: 1rem 0.75rem;
        margin: 10px 5px;
    }
    
    h2.title-rekomendasi {
        font-size: 1.3rem;
    }
    
    .user-info {
        padding: 10px;
    }
    
    .user-info h6 {
        font-size: 0.95rem;
    }
    
    .user-info table {
        font-size: 12px;
    }
    
    .alert {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .alert ul {
        padding-left: 1.2rem;
        font-size: 0.85rem;
    }
    
    .skor-detail {
        font-size: 0.7em;
    }
    
    .mt-4.text-center a {
        display: block;
        width: 100%;
        margin: 0 0 10px 0 !important;
    }
    
    .required {
        font-size: 1.2em;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 700px; 
    }
    
    table {
        font-size: 11px;
    }
    
    table th, table td {
        padding: 0.4rem;
        min-width: 80px;
    }
}

/* Very small devices (max 375px) */
@media (max-width: 375px) {
    .card-login {
        padding: 1rem 0.75rem;
    }
    
    h3.title-login {
        font-size: 1.2rem;
    }
    
    .btn {
        font-size: 14px;
        padding: 0.65rem 0.75rem;
        min-height: 44px;
    }
    
    .card-rekomendasi {
        padding: 0.75rem 0.5rem;
    }
    
    h2.title-rekomendasi {
        font-size: 1.1rem;
    }
    
    .user-info table {
        font-size: 11px;
    }
    
    .card-kuesioner {
        padding: 0.75rem 0.5rem;
    }
    
    h2.title-kuesioner {
        font-size: 1.15rem;
    }
    
    .form-control {
        font-size: 16px !important;
        padding: 0.65rem !important;
        min-height: 44px !important;
    }
    
    select.form-control {
        padding-right: 2rem !important;
    }
    
    label {
        font-size: 13px;
    }
    
    .form-text {
        font-size: 11px;
    }
    
    .table-responsive table {
        min-width: 650px;
    }
    
    table {
        font-size: 10px;
    }
    
    table th, table td {
        padding: 0.3rem;
        min-width: 70px;
    }
}

/* Landscape orientation for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .card-login {
        max-width: 80%;
        margin: 10px auto;
    }
    
    .main-content {
        padding: 5px;
    }
    
    .card-rekomendasi {
        margin: 10px auto;
    }
}

/* Print styles */
@media print {
    body.sport-bg::before {
        display: none;
    }
    
    .navbar, footer, .btn {
        display: none;
    }
    
    .main-content {
        padding: 0;
    }
}