/* General Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: #D81159;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.logo {
    margin-bottom: 20px;
}

.logo img {
    max-width: 100%;
    height: auto;
    max-height: 60px;
}

h2 {
    color: #D81159;
    margin-bottom: 30px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn-login {
    background-color: #D81159;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #b30e4a;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.btn-logout, .btn-back {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover, .btn-back:hover {
    background-color: #e0e0e0;
}

.dashboard-content {
    flex: 1;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-weight: 600;
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    background-color: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #D81159;
    border-bottom-color: #D81159;
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

.data-table tr:hover {
    background-color: #f5f5f5;
}

.btn-view, .btn-delete {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    margin-right: 5px;
}

.btn-view {
    background-color: #D81159;
    color: white;
}

.btn-export {
    display: inline-block;
    padding: 6px 12px;
    background-color: #17a2b8;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    margin-left: 10px;
}

.btn-export:hover {
    background-color: #138496;
}

.btn-delete {
    background-color: #f44336;
    color: white;
}

.btn-view:hover {
    background-color: #b30e4a;
}

.btn-delete:hover {
    background-color: #d32f2f;
}

.risk-level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.risk-level.low {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.risk-level.moderate {
    background-color: #fff3e0;
    color: #e65100;
}

.risk-level.high {
    background-color: #ffebee;
    color: #c62828;
}

.risk-level.critical {
    background-color: #4a0404;
    color: white;
}

.info-text {
    font-size: 14px;
    color: #757575;
    font-weight: normal;
}

.no-data {
    padding: 20px;
    text-align: center;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Survey Details Page */
.survey-details {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 30px;
}

.survey-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.meta-item {
    font-size: 16px;
}

.survey-score {
    margin-bottom: 30px;
}

.score-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 40px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.score-value {
    font-size: 48px;
    font-weight: 700;
    color: #D81159;
}

.score-max {
    font-size: 24px;
    color: #757575;
}

.risk-factors {
    margin-bottom: 30px;
}

.risk-factor {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.factor-name {
    width: 200px;
    font-weight: 500;
}

.factor-bar {
    flex: 1;
    height: 12px;
    background-color: #eee;
    border-radius: 6px;
    overflow: hidden;
    margin: 0 15px;
}

.factor-fill {
    height: 100%;
    background-color: #D81159;
    border-radius: 6px;
}

.factor-score {
    width: 60px;
    text-align: right;
    font-weight: 500;
}

.recommendations {
    margin-bottom: 30px;
}

.recommendation-item {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.raw-data {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 30px;
}

.raw-data pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    white-space: pre-wrap;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .survey-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .risk-factor {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .factor-name {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .factor-bar {
        width: 100%;
        margin: 5px 0;
    }
    
    .factor-score {
        width: 100%;
        text-align: left;
        }
    
    .data-table {
        display: block;
        overflow-x: auto;
        }
}

/* Print styles for PDF export from view_survey */
@media print {
    .btn-logout,
    .btn-back,
    .btn-export,
    .tabs,
    .data-table .btn-view,
    .data-table .btn-delete {
        display: none !important;
    }

    .meta-name,
    .meta-email {
        display: none !important;
    }

    body {
        background-color: #ffffff;
    }

    .dashboard-content {
        max-width: 100%;
        margin: 0;
        padding: 20px;
    }

    .survey-details {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }
}
