/* Smart Lost & Found Portal - Stylesheet */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --lost-color: #ef4444;
    --found-color: #22c55e;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #f8fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

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

/* Header */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    height: 38px;
    width: auto;
}

.logo-icon {
    background: var(--primary-color);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-weight: bold;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.main-nav {
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.main-nav a:hover {
    background: var(--bg-color);
    text-decoration: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

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

.btn-secondary:hover {
    background: #475569;
    text-decoration: none;
}

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

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

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

.hero .btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
}

/* Search Section */
.search-section {
    background: var(--white);
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input, .search-select {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
}

/* Items Section */
.items-section {
    padding: 50px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.75rem;
}

.view-all {
    color: var(--primary-color);
    font-weight: 500;
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.item-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.item-image {
    position: relative;
    height: 200px;
    background: var(--bg-color);
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    font-size: 0.875rem;
}

.item-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.item-badge.lost {
    background: var(--lost-color);
    color: white;
}

.item-badge.found {
    background: var(--found-color);
    color: white;
}

.item-info {
    padding: 20px;
}

.item-info h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.item-category {
    display: inline-block;
    background: var(--bg-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.item-description {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.item-location, .item-date, .item-poster {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

/* Features Section */
.features-section {
    background: var(--white);
    padding: 60px 0;
    text-align: center;
}

.features-section h2 {
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature {
    padding: 30px;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 20px;
}

.feature h3 {
    margin-bottom: 10px;
}

.feature p {
    color: var(--text-light);
}

/* Footer */
.site-footer {
    background: var(--text-color);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255,255,255,0.7);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom p {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
}

/* Auth Forms */
.auth-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 30px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-section {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--radius);
    margin: 20px 0;
}

.form-section h3 {
    margin-bottom: 10px;
}

.form-help {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 15px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.form-container {
    max-width: 700px;
    margin: 40px auto;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-container h1 {
    margin-bottom: 30px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert ul {
    margin-left: 20px;
    margin-top: 10px;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-light);
    margin-top: 5px;
}

.dashboard-section {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

/* Tables */
.items-table-wrapper {
    overflow-x: auto;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table th,
.items-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.items-table th {
    background: var(--bg-color);
    font-weight: 600;
}

.items-table tr:hover {
    background: var(--bg-color);
}

.table-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.actions-cell {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.status-select {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-lost { background: #fef2f2; color: #b91c1c; }
.badge-found { background: #f0fdf4; color: #166534; }
.badge-open { background: #eff6ff; color: #1d4ed8; }
.badge-returned { background: #f0fdf4; color: #166534; }
.badge-claimed { background: #fef3c7; color: #92400e; }
.badge-pending { background: #eff6ff; color: #1d4ed8; }
.badge-accepted { background: #f0fdf4; color: #166534; }
.badge-rejected { background: #fef2f2; color: #b91c1c; }
.badge-review { background: #fef3c7; color: #92400e; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.empty-state p {
    margin-bottom: 20px;
}

/* Item Detail */
.item-detail {
    margin: 40px 0;
}

.item-detail-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.item-detail-image {
    position: relative;
}

.item-detail-image img {
    width: 100%;
    border-radius: var(--radius);
}

.no-image-large {
    height: 400px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--text-light);
}

.item-badge.large {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.item-detail-info h1 {
    margin-bottom: 15px;
}

.item-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.item-details-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    gap: 10px;
}

.detail-item strong {
    min-width: 120px;
    color: var(--text-light);
}

.item-description {
    margin-top: 25px;
}

.item-description h3 {
    margin-bottom: 10px;
}

/* Claim Section */
.claim-section,
.claims-section {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.claim-section h2,
.claims-section h2 {
    margin-bottom: 20px;
}

.claim-form .form-group {
    margin-bottom: 20px;
}

/* Claims List */
.claims-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.claim-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
}

.claim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.claimant-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.claim-score {
    margin-bottom: 15px;
}

.score-bar {
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
}

.claim-description,
.claim-answer,
.claim-contact {
    margin-bottom: 15px;
}

.claim-date {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.claim-actions {
    display: flex;
    gap: 10px;
}

/* Matches Section */
.matches-section {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.matches-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.match-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 20px;
}

.match-score {
    text-align: center;
    min-width: 80px;
}

.score-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.match-level {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.match-level.high { background: #f0fdf4; color: #166534; }
.match-level.medium { background: #fef3c7; color: #92400e; }
.match-level.low { background: #fef2f2; color: #b91c1c; }

.match-item {
    flex: 1;
}

.match-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.match-item h4 {
    margin-bottom: 8px;
}

.match-location {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 10px 0;
}

/* Filter Form */
.filter-form {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-input,
.filter-select {
    flex: 1;
    min-width: 150px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.page-info {
    color: var(--text-light);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 30px;
}

.page-header h1 {
    margin: 0;
}

.subtitle {
    color: var(--text-light);
    margin-top: 5px;
}

/* My Claims Page */
.claims-list-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.claim-card-horizontal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 20px;
    box-shadow: var(--shadow);
}

.claim-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.claim-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

.claim-content {
    flex: 1;
}

.claim-content h3 {
    margin-bottom: 10px;
}

.claim-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}

.claim-status-indicator {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    text-align: center;
    align-self: center;
}

.status-pending { background: #eff6ff; color: #1d4ed8; }
.status-accepted { background: #f0fdf4; color: #166534; }
.status-rejected { background: #fef2f2; color: #b91c1c; }
.status-review { background: #fef3c7; color: #92400e; }

/* Matches Page */
.item-summary {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.summary-image {
    width: 100px;
    height: 100px;
}

.summary-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

.summary-info h3 {
    margin-bottom: 10px;
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.match-card-detailed {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    display: flex;
    gap: 25px;
    box-shadow: var(--shadow);
}

.match-score-section {
    text-align: center;
    min-width: 100px;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.score-circle.high { background: #f0fdf4; border: 3px solid #22c55e; }
.score-circle.medium { background: #fef3c7; border: 3px solid #f59e0b; }
.score-circle.low { background: #fef2f2; border: 3px solid #ef4444; }

.score-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.score-percent {
    font-size: 0.75rem;
}

.match-level-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.match-content {
    flex: 1;
    display: flex;
    gap: 20px;
}

.match-image {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

.match-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

.match-details {
    flex: 1;
}

.match-details h3 {
    margin-bottom: 10px;
}

.match-description {
    color: var(--text-light);
    margin: 15px 0;
}

.match-meta {
    margin-bottom: 15px;
}

.match-meta p {
    font-size: 0.875rem;
    margin-bottom: 5px;
}

/* Results Count */
.results-count {
    color: var(--text-light);
    margin-bottom: 20px;
}

.search-info {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* No Image Small */
.no-image-small {
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--text-light);
    font-size: 0.75rem;
}

.table-no-image {
    color: var(--text-light);
}

/* Verification Question */
.verification-question {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--radius);
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .item-detail-main {
        grid-template-columns: 1fr;
    }
    
    .claim-card-horizontal {
        flex-direction: column;
    }
    
    .claim-image {
        width: 100%;
        height: 200px;
    }
    
    .match-card-detailed {
        flex-direction: column;
    }
    
    .match-content {
        flex-direction: column;
    }
    
    .match-image {
        width: 100%;
        height: 200px;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .dashboard-header,
    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* =====================================================
   CHAT SYSTEM STYLES
   ===================================================== */

/* Logo Image */
.logo-img {
    height: 40px;
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
}

/* Chat Page */
.chat-page {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 15px;
}

.chat-info h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: var(--text);
}

.chat-item a {
    color: var(--primary);
    text-decoration: none;
}

.chat-item a:hover {
    text-decoration: underline;
}

.chat-role {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.chat-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--success-light, #d4edda);
    border-radius: var(--radius);
    color: var(--success, #28a745);
    font-weight: 600;
}

.chat-timer.warning {
    background: var(--warning-light, #fff3cd);
    color: var(--warning, #856404);
}

.timer-icon {
    font-size: 1.25rem;
}

/* Chat Container */
.chat-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 30px;
}

/* Messages Area */
.messages-area {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-secondary, #f8f9fa);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.no-messages {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-style: italic;
}

/* Individual Message */
.message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: var(--card-bg);
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.75rem;
    opacity: 0.8;
}

.sender-name {
    font-weight: 600;
}

.message-time {
    font-size: 0.7rem;
}

.message-content {
    line-height: 1.5;
    word-wrap: break-word;
}

.contact-message {
    border: 2px solid var(--primary);
}

.contact-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-bottom: 5px;
}

.message.sent .contact-badge {
    background: white;
    color: var(--primary);
}

/* Message Input */
.message-input-area {
    padding: 15px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
}

.message-form {
    display: flex;
    gap: 10px;
}

.message-form textarea {
    flex: 1;
    resize: none;
    height: 50px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 12px 15px;
    font-family: inherit;
    font-size: 0.95rem;
}

.message-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light, rgba(0, 123, 255, 0.1));
}

.message-form button {
    padding: 12px 25px;
    white-space: nowrap;
}

/* Share Contact Section */
.share-contact-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.share-contact-section h3 {
    margin-bottom: 10px;
    color: var(--text);
}

.section-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.shared-contacts-list {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 20px;
}

.shared-contacts-list h4 {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: var(--text);
}

.contact-card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.contact-card:last-child {
    margin-bottom: 0;
}

.contact-card strong {
    color: var(--primary);
    display: block;
    margin-bottom: 8px;
}

.contact-card p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.contact-card .label {
    color: var(--text-muted);
    margin-right: 5px;
}

.shared-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.contact-form .form-group {
    margin-bottom: 0;
}

.contact-form textarea {
    min-height: 80px;
}

/* Chat Actions */
.chat-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

/* My Chats Page */
.my-chats-page {
    padding: 30px 0;
    background: #f5f7fb;
    min-height: calc(100vh - 120px);
}

.my-chats-page .container {
    max-width: 1180px;
    margin: 0 auto;
}

.my-chats-page .page-header {
    margin-bottom: 24px;
}

.my-chats-page .page-header h1 {
    margin-bottom: 8px;
    font-size: 2rem;
}

.my-chats-page .page-header p {
    color: #5c6a82;
}

.my-chats-page .no-chats {
    text-align: center;
    padding: 40px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.my-chats-page .no-chats-icon {
    font-size: 48px;
    margin-bottom: 18px;
}

.my-chats-page .no-chats-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.my-chats-page .chats-list {
    display: grid;
    gap: 18px;
}

.chat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    display: grid;
    gap: 14px;
    transition: box-shadow .2s ease;
}

.chat-card:hover {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.chat-card.urgent {
    border-left-color: var(--warning, #ffc107);
}

.chat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.chat-card-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text);
}

.timer {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    background: #e2e8f0;
    color: #1f2937;
}

.timer.urgent {
    background: #fee2e2;
    color: #b91c1c;
}

.chat-card-body {
    color: #334155;
    line-height: 1.6;
}

.chat-with {
    margin-bottom: 10px;
}

.chat-with .label {
    color: var(--text-muted);
    margin-right: 5px;
}

.role-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 5px;
}

.last-message {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.last-message .label {
    font-style: normal;
    color: var(--text);
}

.chat-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.chat-meta {
    color: #64748b;
    font-size: 0.95rem;
}

.unread-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn .badge {
    background: white;
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 5px;
}

/* Chat Info Section */
.chat-info-section {
    margin-top: 32px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.chat-info-section h3 {
    margin-bottom: 15px;
    color: var(--text);
}

.chat-info-section ul {
    margin: 16px 0 0;
    padding-left: 20px;
}

.chat-info-section li {
    margin-bottom: 10px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Responsive Chat Styles */
@media (max-width: 768px) {
    .chat-header {
        flex-direction: column;
    }
    
    .messages-area {
        height: 300px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .message-form {
        flex-direction: column;
    }
    
    .message-form textarea {
        height: 60px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .chat-actions {
        flex-direction: column;
    }
    
    .chat-card-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .chat-meta {
        flex-direction: column;
        gap: 5px;
    }
}
