:root {
    --primary-color: #D32F2F;
    --primary-light: #FFCDD2;
    --primary-dark: #B71C1C;
    --accent-color: #FF5252;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-main: #212121;
    --text-muted: #757575;
    --border-radius: 20px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    background: #fff;
    padding: 0.6rem 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 12px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 12px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(211, 47, 47, 0.05);
}

/* Predictor Page Responsiveness */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-lg-7 {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
    padding: 0 15px;
    order: 1;
}

.col-lg-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    padding: 0 15px;
    order: 2;
}

@media (max-width: 768px) {
    .nav-link span {
        display: none;
    }

    .nav-link i {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-logo span {
        font-size: 1rem;
    }

    .nav-logo i {
        font-size: 1.2rem;
    }
}

@media (max-width: 991px) {
    .row {
        flex-direction: column;
    }

    .col-lg-7,
    .col-lg-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .col-lg-7 {
        order: 1;
    }

    .col-lg-5 {
        order: 2;
        margin-top: 30px;
    }

    .auth-card {
        padding: 25px 15px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }

    .content-wrapper {
        margin-top: 20px;
        padding: 0 15px;
    }
}

/* Status Badges Matching App */
.status-pill {
    padding: 6px 14px;
    border-radius: 50px;
    /* Highly rounded as in screenshot */
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pill.success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.status-pill.danger {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid rgba(198, 40, 40, 0.2);
}

/* Clickable History Rows */
.clickable-row {
    cursor: pointer;
    transition: background 0.2s;
}

.clickable-row:hover {
    background: #f9f9f9;
}

/* Report Styles */
.result-hero-card {
    text-align: left;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.progress-bar-container.large {
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.4s ease;
}

.flash-message.error {
    background: #FFEBEE;
    color: #C62828;
    border-left: 5px solid #C62828;
}

.flash-message.success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left: 5px solid #2E7D32;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-card {
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.auth-header p {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

input,
select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2.5px solid #E0E0E0;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.1);
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.3);
}

.auth-btn {
    width: 100%;
    margin-top: 10px;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Predictor Page */
.predictor-container {
    padding: 20px 0;
}

.card-header-icon {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.card-header-icon i {
    font-size: 3rem;
    color: var(--primary-color);
}

.header-text h2 {
    color: var(--primary-color);
    font-weight: 800;
    line-height: 1;
    margin: 0;
}

.header-text h3 {
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1;
    margin: 0;
}

.form-instruction {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.col-half {
    flex: 1;
    min-width: 200px;
}

/* Slider Styling */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: #EEEEEE;
    outline: none;
    margin: 15px 0;
    border: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(211, 47, 47, 0.3);
    border: 3px solid #fff;
}

.display-val {
    float: right;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Custom Radio Group */
.custom-radio-group {
    display: flex;
    gap: 12px;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-label input {
    display: none;
}

.radio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    border-radius: 12px;
    border: 2px solid #F0F0F0;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    background: #F9F9F9;
}

/* Mobile Specific Refinements */
@media (max-width: 480px) {
    .card {
        padding: 20px 15px;
    }

    .predictor-card {
        margin-top: 10px;
    }

    .header-text h2 {
        font-size: 1.6rem;
    }

    .header-text h3 {
        font-size: 1.3rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .radio-btn {
        padding: 10px 5px;
        font-size: 0.85rem;
    }

    .btn-primary {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

input,
select,
.custom-input,
.custom-select {
    background: #F9F9F9;
    border: 2px solid #F0F0F0;
    color: #333;
}

.radio-label input:checked+.radio-btn {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Result Card */
.result-card {
    background: var(--card-bg);
}

.stage-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stage-stage-1 {
    background: #E8F5E9;
    color: #2E7D32;
}

.stage-stage-2 {
    background: #FFF3E0;
    color: #EF6C00;
}

.stage-stage-3 {
    background: #FFEBEE;
    color: #C62828;
}

.stage-stage-4 {
    background: #212121;
    color: #FFFFFF;
}

.result-header h2 {
    font-size: 2rem;
    margin-bottom: 25px;
}

.probability-section {
    margin-bottom: 30px;
}

.prob-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.prob-value {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.progress-bar-container {
    height: 12px;
    background: #F0F0F0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    transition: width 1s ease-out;
}

.insight-card {
    background: #FFF8F8;
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 30px;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.insight-header h4 {
    font-weight: 700;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-secondary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
}

.btn-outline {
    background: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

.empty-result {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 400px;
}

.empty-content i {
    font-size: 4rem;
    color: #E0E0E0;
    margin-bottom: 20px;
}

.empty-content h4 {
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Dashboard / History */
.history-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.history-table-wrapper {
    overflow-x: hidden;
    padding: 0 !important;
}

.styled-table {
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
}

.btn-export {
    padding: 0 !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    background: transparent !important;
    color: var(--primary-color) !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: 0.2s;
}

.btn-export:hover {
    color: var(--primary-dark) !important;
    transform: none !important;
}

.btn-export i {
    font-size: 1.1rem;
    color: var(--primary-color) !important;
}

@media (max-width: 768px) {
    .btn-export {
        background: #fff !important;
        /* Outline style for Mobile */
        color: var(--primary-color) !important;
        border: 2px solid var(--primary-color) !important;
    }
}

.chart-card {
    margin-bottom: 40px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.card-title i {
    color: var(--primary-color);
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
}

.styled-table thead tr {
    background-color: #F8F9FA;
}

.styled-table th {
    text-align: left;
    padding: 10px 8px;
    color: #757575;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.styled-table td {
    padding: 12px 8px;
    border-top: 1px solid #F0F0F0;
    vertical-align: middle;
}

.timestamp {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timestamp .date {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: #333;
}

.timestamp .time {
    color: #888;
    font-size: 0.75rem;
}

.status-pill {
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-block;
    text-align: center;
    line-height: normal;
}

.status-pill.danger {
    background: #FFEBEE;
    color: #C62828;
}

.status-pill.success {
    background: #E8F5E9;
    color: #2E7D32;
}

.risk-val {
    font-weight: 700;
    color: #333;
    font-size: 0.85rem;
}

.btn-icon {
    color: #555;
    font-size: 1rem;
    text-decoration: none;
    transition: 0.2s;
    display: flex;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--primary-color);
}

/* Animations */
.animate-in {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@media (max-width: 480px) {
    .nav-user {
        display: none;
    }

    .nav-container {
        padding: 0 10px;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-link {
        padding: 8px;
    }

    .auth-card {
        padding: 20px;
    }

    .styled-table th,
    .styled-table td {
        padding: 12px 10px;
    }

    .timestamp .date {
        font-size: 0.85rem;
    }

    .status-pill {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
}

.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    border-top: 1px solid #E0E0E0;
    font-size: 0.9rem;
}