/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s ease;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    min-height: 100vh;
}

/* ===== Navigation ===== */
.navbar {
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    /* switched to grid to place logo, nav-menu (center) and nav-right (end) */
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    position: relative;
}

/* place the nav menu centered */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    justify-self: center; /* center column content */
}

/* left column = logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-self: start;
}

.logo-image {
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: none;
}

.logo-image[src]:not([src=""]) {
    display: block;
}

.logo-text {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
    display: block;
}

/* hamburger / toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.25rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

/* ===== Navigation Right Section ===== */
/* right column = icons */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-self: end; /* ensure icons are at the rightmost grid column */
}

.language-selector {
    display: flex;
    align-items: center;
}

.language-select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.language-select:hover,
.language-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-icon-btn,
.menu-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    /* increase z so icons sit above hero shadow if necessary */
    z-index: 1100;
}

.user-icon-btn:hover,
.menu-icon-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
}

.menu-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    list-style: none;
    padding: 0.5rem 0;
    min-width: 180px;
    display: none;
    z-index: 1000;
}

/* Navbar dropdown menu - align to right end of navbar */
.navbar .nav-right .menu-dropdown {
    position: relative;
}

/* Position dropdown to align with right edge of navbar container */
.navbar .nav-container .nav-right .menu-dropdown .dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    transform-origin: top right;
}

.dropdown-menu.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.dropdown-link:hover,
.dropdown-link.active {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
}

.dropdown-link#logout-link {
    color: var(--danger-color);
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.dropdown-link#logout-link:hover {
    background-color: #fee2e2;
}

/* ===== Container & Pages ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

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

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Solved Issues Section ===== */
.solved-issues-section {
    margin-bottom: 3rem;
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.solved-issues-section h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

/* ===== Achievements Section ===== */
.achievements-section {
    margin-bottom: 3rem;
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.achievements-section h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.achievement-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--bg-tertiary);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievement-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.achievement-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.achievement-item:hover .achievement-image {
    transform: scale(1.05);
}

/* ===== Forms ===== */
.issue-form {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.form-group input[type="text"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
}

/* ===== Map Container ===== */
.map-container {
    margin-top: 1rem;
    position: relative;
}

.map {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
}

.map-instructions {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

/* ===== Image Preview ===== */
.image-preview-container {
    margin-top: 1rem;
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    object-fit: cover;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ===== Issues Grid ===== */
.issues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.issue-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    animation: slideUp 0.3s ease-out;
}

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

.issue-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.issue-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.issue-content {
    padding: 1.5rem;
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.issue-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    flex: 1;
}

.issue-status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.status-open {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-in-progress {
    background-color: #fef3c7;
    color: #92400e;
}

.status-resolved {
    background-color: #d1fae5;
    color: #065f46;
}

.issue-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.issue-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.issue-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.issue-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-critical {
    background-color: #fee2e2;
    color: #991b1b;
}

.priority-moderate {
    background-color: #fef3c7;
    color: #92400e;
}

.priority-minor {
    background-color: #dbeafe;
    color: #1e40af;
}

.issue-assigned {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.issue-assigned span {
    color: var(--text-secondary);
}

.issue-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.upvote-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 2px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 600;
}

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

.upvote-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.comment-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
}

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

/* ===== Filters ===== */
.filters {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

#modal-body {
    padding: 2rem;
}

.modal-issue-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.modal-issue-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-issue-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-issue-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.status-progress {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    position: relative;
}

.status-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--border-color);
    z-index: 0;
}

.status-step {
    background: var(--bg-primary);
    border: 3px solid var(--border-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.status-step.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.status-step.completed {
    border-color: var(--secondary-color);
    background-color: var(--secondary-color);
    color: white;
}

.status-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.comments-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.comment-text {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ===== Representative Info ===== */
.representative-info {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
}

.representative-info h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.representative-info p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.representative-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.representative-info a:hover {
    text-decoration: underline;
}

/* ===== Escalation History ===== */
.escalation-history {
    background: #fef3c7;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    border-left: 4px solid var(--warning-color);
}

.escalation-history h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.escalation-item {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.escalate-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

/* ===== Track Representative ===== */
.track-representative,
.track-priority {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.track-representative h4,
.track-priority h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.track-representative p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.track-representative a {
    color: var(--primary-color);
    text-decoration: none;
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    display: none;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.toast.show {
    display: block;
}

.toast.success {
    background-color: var(--secondary-color);
}

.toast.error {
    background-color: var(--danger-color);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== No Issues Message ===== */
.no-issues {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.featured-issues {
    margin-top: 3rem;
}

.featured-issues h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

/* ===== Track Issue Page ===== */
.track-issue-form {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.track-issue-form .form-group {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.track-issue-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.track-issue-form .form-group input {
    flex: 1;
}

.track-result {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 800px;
    margin: 0 auto;
}

.track-progress {
    margin: 2rem 0;
}

.track-progress-bar {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 3rem;
}

.track-progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--border-color);
    z-index: 0;
}

.track-step {
    background: var(--bg-primary);
    border: 3px solid var(--border-color);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.track-step.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.track-step.completed {
    border-color: var(--secondary-color);
    background-color: var(--secondary-color);
    color: white;
}

.track-step-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.track-step-labels span {
    max-width: 100px;
    text-align: center;
}

.done-btn-container {
    text-align: center;
    margin-top: 2rem;
}

/* ===== Submit Success Message ===== */
.submit-success {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 2rem auto 0;
    text-align: center;
}

.success-message h3 {
    color: var(--secondary-color);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.success-message p {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.success-message strong {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* ===== Voice Recording ===== */
.voice-recording-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.voice-status {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
}

/* ===== Address Fields ===== */
.address-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.address-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.address-field {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.address-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

@media (max-width: 768px) {
    .address-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Upload Container ===== */
.upload-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.upload-container input[type="file"] {
    flex: 1;
}

/* ===== Reviews Page ===== */
.reviews-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-item {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.review-rating {
    display: flex;
    gap: 0.25rem;
    color: var(--warning-color);
    font-size: 1.25rem;
}

.review-author {
    font-weight: 600;
    color: var(--text-primary);
}

.review-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.review-text {
    color: var(--text-primary);
    line-height: 1.6;
}

.review-form-section {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.review-form-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* ===== Chatbot Floating Button & Widget ===== */
.chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 25px;
  z-index: 3000;
}

.chatbot-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.chatbot-btn:hover {
  background-color: var(--primary-dark);
  transform: scale(1.1);
}

.chatbot-box {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 320px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

.chatbot-header {
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.chatbot-header button {
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
}

.chatbot-messages {
  padding: 1rem;
  height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bot-msg, .user-msg {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  max-width: 80%;
}

.bot-msg {
  background-color: var(--bg-tertiary);
  align-self: flex-start;
}

.user-msg {
  background-color: var(--primary-color);
  color: white;
  align-self: flex-end;
}

.chatbot-input {
  display: flex;
  border-top: 1px solid var(--border-color);
}

.chatbot-input input {
  flex: 1;
  padding: 0.75rem;
  border: none;
  outline: none;
}

.chatbot-input button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0 1rem;
  cursor: pointer;
}

.chatbot-input button:hover {
  background: var(--primary-dark);
}

/* ===== Swap nav-right and nav-menu positions (desktop) ===== */
@media (min-width: 769px) {
  /* Ensure nav-container remains a flex context */
  .nav-container {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  /* Order: logo (0) → nav-menu (1) → nav-right (2) → nav-toggle (3 if present) */
  .logo { order: 0; }

  .nav-menu {
    order: 1;
    /* keep nav-menu centered-ish by allowing it to grow and centering its items */
    margin-left: 1rem;
    margin-right: 1rem;
    display: flex;
    justify-content: center;
    flex: 1 1 auto; /* allow menu to take available center space */
  }

  .nav-right {
    order: 2;
    flex: 0 0 auto; /* keep profile/menu compact on the right */
    margin-left: auto; /* push to the far right */
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .nav-toggle {
    order: 3;
  }

  /* Slight tweak: keep nav links inline and centered visually */
  .nav-menu .nav-link {
    margin: 0 0.75rem;
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    /* show hamburger and use original mobile behavior */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-primary);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        gap: 0;
        justify-self: start; /* reset centering for mobile menu */
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    /* hide right icons on small screens (they were moved into the hamburger) */
    .nav-right {
        display: none;
    }

    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .achievements-section {
        padding: 1.5rem;
    }

    .achievements-section h3 {
        font-size: 1.5rem;
    }

    .reviews-section {
        grid-template-columns: 1fr;
    }

    .track-issue-form .form-group {
        flex-direction: column;
        align-items: stretch;
    }

    .issues-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .issue-form {
        padding: 1.5rem;
    }

    .modal-content {
        margin: 1rem;
        max-height: 95vh;
    }

    #modal-body {
        padding: 1.5rem;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .auth-modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .issue-type-selector {
        flex-direction: column;
    }

    .workers-grid {
        grid-template-columns: 1fr;
    }

    .agent-help-section {
        grid-template-columns: 1fr;
    }

    .agent-search-section .form-group {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .issue-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .upvote-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== Auth Modals ===== */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2500;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

.auth-modal.active {
    display: flex;
}

.auth-modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
    padding: 2rem;
}

.auth-form {
    margin-top: 1.5rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.5rem;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ===== Issue Type Selector ===== */
.issue-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--bg-primary);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.issue-type-btn {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.issue-type-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.issue-type-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ===== Workers Page ===== */
.workers-filter {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.workers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.worker-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    transition: var(--transition);
    animation: slideUp 0.3s ease-out;
    border: 2px solid transparent;
}

.worker-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.worker-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.worker-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.worker-rating {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.rating-stars {
    color: var(--warning-color);
    font-size: 1rem;
}

.rating-value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.worker-details {
    margin-bottom: 1rem;
}

.worker-details p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.worker-job-role {
    font-weight: 600;
    color: var(--primary-color) !important;
    font-size: 1rem !important;
}

.worker-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ===== Agent Dashboard ===== */
.agent-search-section {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.agent-search-section .form-group {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.agent-search-section .form-group input {
    flex: 1;
}

.agent-result {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.agent-issue-details {
    animation: fadeIn 0.3s ease-in;
}

.agent-issue-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.agent-issue-info {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-section {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.info-section h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.info-section p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.issue-id-display {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
    letter-spacing: 2px;
}

.agent-actions {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.agent-help-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.help-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
}

.help-card h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.help-card ul {
    list-style: none;
    padding: 0;
}

.help-card ul li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    padding-left: 1.5rem;
    position: relative;
}

.help-card ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* ===== Animations ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animated {
    animation: fadeIn 0.5s ease-in;
}

/* ===== Professional Enhancements ===== */
.issue-form,
.worker-card,
.agent-result {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced cards */
.issue-card,
.worker-card {
    position: relative;
    overflow: hidden;
}

.issue-card::before,
.worker-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.issue-card:hover::before,
.worker-card:hover::before {
    left: 100%;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Enhanced focus states */
input:focus,
select:focus,
textarea:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}
