:root {
    /* Color Palette (Soft Blue/Green - Trust + Tech) */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    --primary: #10b981; /* Emerald Green */
    --primary-hover: #059669;
    --primary-light: rgba(16, 185, 129, 0.15);
    
    --secondary: #0ea5e9; /* Sky Blue */
    --secondary-hover: #0284c7;
    --secondary-light: rgba(14, 165, 233, 0.15);
    
    --gradient-primary: linear-gradient(135deg, #10b981, #059669);
    --gradient-hover: linear-gradient(135deg, #059669, #047857);
    
    --border-color: #e2e8f0;
    --error: #ef4444;
    --success: #10b981;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Radius */
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Animation */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sections & Visibility */
.section {
    flex: 1;
    display: none;
    padding: 2rem 1.5rem;
    animation: fadeIn 0.4s ease-out forwards;
}

.section.active {
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

#landing-page.active {
    align-items: center;
    justify-content: center;
}

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

/* Container */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 3rem;
    margin-top: 1rem;
}

.app-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* Navigation Add-ons */
.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.nav-back:hover {
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 2rem;
    width: 100%;
}

.landing-card {
    max-width: 440px;
    text-align: center;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
}

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

.select-wrapper {
    position: relative;
}

.select-input, .text-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    appearance: none;
    background-color: var(--bg-color);
    color: var(--text-main);
}

.select-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.select-input:focus, .text-input:focus {
    border-color: var(--primary);
    background-color: var(--card-bg);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

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

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

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

/* Typography Specific */
.title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.logo-icon {
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 120px;
    height: 120px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border: 2px solid rgba(16, 185, 129, 0.2);
}
.worker-icon {
    max-width: 100%;
    height: auto;
    transform: translateY(15px);
}

/* Grid System */
.card-grid {
    display: grid;
    gap: 1.5rem;
}

.col-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .col-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.col-2 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .col-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Action Cards */
.action-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

a.action-card,
a.action-card:visited {
    color: inherit;
    text-decoration: none;
}

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

.action-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.action-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.card-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background-color: var(--primary-light);
    transition: var(--transition);
}

.action-card:hover .card-icon {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.05);
}

/* Progress indicator */
.progress-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.progress-step {
    flex: 1;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    transition: var(--transition);
}

.progress-step.active {
    color: var(--primary);
}

.progress-step::after {
    content: '';
    position: absolute;
    bottom: -18px; /* Push to the border bottom line */
    left: 10%;
    width: 80%;
    height: 3px;
    background-color: transparent;
    transition: var(--transition);
    border-radius: var(--radius-full);
}

.progress-step.active::after {
    background: var(--gradient-primary);
}

/* AI Flow Vis */
.ai-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}

@media (min-width: 768px) {
    .ai-flow {
        flex-direction: row;
        justify-content: space-between;
    }
}

.flow-step {
    text-align: center;
    flex: 1;
    position: relative;
    max-width: 150px;
}

.flow-icon {
    width: 70px;
    height: 70px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--text-muted);
    margin: 0 auto 0.75rem;
    transition: var(--transition);
}

.flow-step h4 { font-size: 1.125rem; margin-bottom: 0.25rem; font-weight: 600; }
.flow-step p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.2; }

.primary-icon {
    border-color: transparent; /* Use gradient border via wrapper if needed, or solid fallback */
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.active-pulse .flow-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--border-color);
    transform: rotate(90deg);
}

@media (min-width: 768px) {
    .flow-arrow {
        transform: rotate(0);
        margin: 0 0.5rem;
    }
}

/* Tabs */
.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab-buttons::-webkit-scrollbar {
    height: 4px;
}

.tab-buttons::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: var(--bg-color);
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    border: 1px solid var(--border-color);
}

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

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



/* Announcement Card */
.ad-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition);
    background: var(--card-bg);
    cursor: pointer;
}
.ad-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.ad-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ad-badge.job { background: #e0f2fe; color: #0284c7; }
.ad-badge.service { background: #dcfce7; color: #166534; }
.ad-badge.material { background: #fef3c7; color: #b45309; }
.ad-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; line-height: 1.3; }
.ad-detail { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.5rem; }
.ad-detail i { width: 16px; text-align: center; }
.ad-price { font-size: 1.25rem; font-weight: 700; color: var(--text-main); margin: 1rem 0; border-top: 1px dashed var(--border-color); padding-top: 1rem;}

/* Profile Avatar */
.profile-avatar {
    width: 90px;
    height: 90px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
}

/* Reviews List */
.review-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.review-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ========================================= */
/* WORKER DASHBOARD SPECIFIC STYLES          */
/* ========================================= */

.dash-bg {
    background: linear-gradient(to bottom, #f0f7ff 0%, #e0f2fe 100%);
    position: relative;
    padding: 1.5rem 1rem !important;
}

.dash-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
}

.profile-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background: #e0f2fe;
}

.profile-info {
    flex: 1;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.profile-name-row h3 {
    font-size: 1.125rem;
    margin: 0;
    color: #1e293b;
    font-weight: 700;
}

.status-online {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 600;
}

.status-online .dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
}

.badge-b6 {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    margin-left: auto;
}

.job-title-dash {
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 0.5rem;
}

.profile-actions-dash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.badge-exp {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #16a34a;
    font-weight: 600;
}

.btn-contact-dash {
    background: #4B6E5A; /* Dark olive green matching standard UI */
    color: white;
    border: none;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* AI Notification Card */
.ai-notification {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(224, 242, 254, 0.7);
    border: 1px solid rgba(255,255,255,0.8);
    position: relative;
}

.ai-icon-dash {
    width: 40px;
    height: 40px;
    background: #3b82f6; /* Blue circle */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.ai-text-dash {
    font-size: 0.9rem;
    line-height: 1.3;
    color: #1e293b;
    flex: 1;
}

.notif-badge {
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Match List */
.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 1rem;
    padding: 0 0.5rem;
}

.section-title-row h3 {
    font-size: 1.1rem;
    color: #334155;
    font-weight: 600;
}

.section-title-row i {
    color: #94a3b8;
    font-size: 1.25rem;
}

.match-card {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    align-items: center;
}

.match-info {
    flex: 1;
}

.match-info h4 {
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
    color: #0f172a;
}

.match-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.match-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #dcfce7;
    color: #166534;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.match-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.btn-accept, .btn-reject {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.btn-accept {
    background: #4B6E5A;
    color: white;
}

.btn-reject {
    background: #dc2626;
    color: white;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.75rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
}

.nav-item {
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-item.active {
    color: #3b82f6;
}

.add-btn {
    width: 50px;
    height: 50px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transform: translateY(-15px);
    box-shadow: 0 4px 10px rgba(16,185,129,0.3);
}

.notif-badge-small {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Custom Modal Alert */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.custom-modal-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    animation: popupIcon 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popupIcon {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.custom-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.custom-modal-message {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.custom-modal-btn {
    width: 100%;
    justify-content: center;
    font-size: 1.1rem;
    padding: 0.875rem;
}

.custom-modal-success .custom-modal-icon {
    color: var(--primary);
}

.custom-modal-error .custom-modal-icon {
    color: var(--error);
}

.custom-modal-info .custom-modal-icon {
    color: var(--secondary);
}
