/* ============================================
   SafeReport – Main Styles
   Dynamic theming via CSS variables
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --primary-light: #93C5FD;
    --secondary: #1a1a1a;
    --accent: #5aa3a6;
    --text-dark: #1a1a1a;
    --text-medium: #444444;
    --text-light: #777777;
    --bg-white: #ffffff;
    --bg-light: #f7f9fa;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f0f0f0;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #e53e3e;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --font-family: 'Inter', sans-serif;
    --header-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Language Switcher --- */
.lang-switcher {
    display: none;
    justify-content: flex-end;
    gap: 6px;
    padding: 12px 0 0;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-white);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s;
}

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

.lang-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* --- Container --- */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.header {
    background: var(--header-gradient);
    color: #ffffff;
    padding: 40px 30px;
    text-align: center;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 0;
}

.logo {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 20px;
}

.logo img {
    max-height: 40px;
    max-width: 200px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 15px;
    font-weight: 300;
    color: var(--primary-light);
    letter-spacing: 1px;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 24px 0;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tab {
    flex: 1;
    padding: 14px 16px;
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.tab:hover {
    color: var(--primary-dark);
    background: var(--bg-light);
}

.tab.active {
    color: var(--primary);
    background: var(--bg-white);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.tab + .tab {
    border-left: 1px solid var(--border-light);
}

/* --- Tab Content --- */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Info Cards --- */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.info-card h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.info-card p {
    color: var(--text-medium);
    font-size: 14px;
    line-height: 1.7;
}

.info-card ul, .info-card ol {
    margin-left: 20px;
    color: var(--text-medium);
    font-size: 14px;
}

.info-card li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.info-card ol li {
    margin-bottom: 10px;
}

.info-card.highlight {
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, #eff6ff 0%, var(--bg-white) 100%);
}

.info-card.warning {
    border-left: 4px solid var(--warning);
    background: linear-gradient(135deg, #fffaf5 0%, var(--bg-white) 100%);
}

/* --- Form Styles --- */
.report-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-group h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.form-hint {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
    margin-top: 4px;
}

.required {
    color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
input[type="url"],
input[type="color"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Radio & Checkbox */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-medium);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.15s;
}

.radio-label:hover, .checkbox-label:hover {
    background: var(--bg-light);
}

.radio-label input, .checkbox-label input {
    margin-top: 3px;
    accent-color: var(--primary);
}

.checkbox-group {
    margin-bottom: 16px;
}

.checkbox-label span {
    line-height: 1.5;
}

/* File Upload */
.file-upload {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.04);
}

.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.file-icon {
    font-size: 24px;
}

.file-upload-label span {
    font-size: 13px;
    color: var(--text-light);
}

.file-hint {
    font-size: 12px !important;
    color: var(--text-light) !important;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-medium);
}

.file-item button {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}

.form-divider {
    height: 1px;
    background: var(--border);
    margin: 28px 0;
}

/* --- Buttons --- */
.btn-submit {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

.btn-submit:active {
    transform: scale(0.99);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

.btn-secondary:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-copy {
    padding: 8px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 8px;
}

.btn-copy:hover {
    background: var(--border);
}

/* --- Success Message --- */
.success-message {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 28px;
    text-align: center;
    box-shadow: var(--shadow);
}

.success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.success-message h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 8px;
}

.success-message > p {
    color: var(--text-medium);
    font-size: 14px;
    margin-bottom: 24px;
}

.case-code-box {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.case-code-box > p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.case-code {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--primary-dark);
    font-family: 'Courier New', monospace;
}

.warning-box {
    background: #fffaf5;
    border: 1px solid #fbd38d;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 20px 0;
    text-align: left;
}

.warning-box p {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.6;
}

.warning-box p + p {
    margin-top: 4px;
}

/* --- Check Status --- */
.check-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow);
}

.check-form h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.check-form > p {
    font-size: 14px;
    color: var(--text-medium);
    margin-bottom: 20px;
}

/* --- Case Details --- */
.case-details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.case-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.case-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.case-status {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-status.new {
    background: #ebf8ff;
    color: #2b6cb0;
}

.case-status.investigating {
    background: #fefcbf;
    color: #975a16;
}

.case-status.resolved {
    background: #f0fff4;
    color: #276749;
}

.case-status.closed {
    background: var(--bg-light);
    color: var(--text-light);
}

.case-info {
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.info-label {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 160px;
}

/* --- Messages --- */
.messages-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.messages-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 4px 0;
}

.message {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.6;
}

.message.reporter {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    margin-left: 24px;
}

.message.admin {
    background: var(--bg-light);
    border: 1px solid var(--border);
    margin-right: 24px;
}

.message.system {
    background: #fffaf5;
    border: 1px solid #fbd38d;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
}

.message-sender {
    font-weight: 600;
    color: var(--text-dark);
}

.message-time {
    color: var(--text-light);
}

.message-text {
    color: var(--text-medium);
}

.message-form {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.message-form textarea {
    margin-bottom: 10px;
}

.message-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-attach {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-attach:hover {
    background: var(--bg-light);
}

.btn-send {
    padding: 8px 20px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-send:hover {
    background: var(--primary-dark);
}

/* --- Case Not Found --- */
.case-not-found {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--danger);
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 32px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.8;
}

.footer-company {
    margin-top: 12px;
    color: var(--text-light);
    opacity: 0.7;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .container {
        padding: 0 12px;
    }

    .header {
        padding: 28px 20px;
        border-radius: 0;
    }

    .header h1 {
        font-size: 22px;
    }

    .tabs {
        border-radius: 6px;
        margin: 16px 0;
    }

    .tab {
        padding: 11px 8px;
        font-size: 12px;
    }

    .info-card, .report-form, .check-form, .case-details {
        padding: 20px 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .case-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .info-row {
        flex-direction: column;
        gap: 2px;
    }

    .info-label {
        min-width: auto;
    }

    .message.reporter {
        margin-left: 8px;
    }

    .message.admin {
        margin-right: 8px;
    }

    .message-form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .message-form-actions .btn-send {
        width: 100%;
    }

    .lang-switcher {
        justify-content: center;
    }
}
