/* ============================================
   NamSIFL Custom CSS - Modern Design System
   ============================================ */

/* CSS Variables - Design Tokens */
:root {
    /* Primary Colors - Matching Header/Navbar */
    --primary-color: #0d6efd;
    --primary-dark: #005cbf;
    --primary-light: #3d8bfd;
    
    /* Secondary Colors */
    --secondary-color: #64748b;
    --secondary-light: #94a3b8;
    
    /* Status Colors */
    --success-color: #10b981;
    --success-dark: #059669;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    
    /* Background Colors */
    --background-light: #f1f5f9;
    --background-white: #ffffff;
    --hover-bg: #f8fafc;
    
    /* Message Colors */
    --message-sent: linear-gradient(135deg, #0d6efd 0%, #3d8bfd 100%);
    --message-received: #f8fafc;
    
    /* Border & Shadow */
    --border-color: #e2e8f0;
    --card-shadow: rgba(13, 110, 253, 0.1);
    --hover-shadow: rgba(13, 110, 253, 0.15);
    --shadow-sm: 0 2px 5px rgba(13, 110, 253, 0.1);
    --shadow-md: 0 4px 10px rgba(13, 110, 253, 0.15);
    --shadow-lg: 0 10px 25px rgba(13, 110, 253, 0.2);
    
    /* Border Radius */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    
    /* Transitions */
    --transition: all 0.3s ease;
    
    /* Typography */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-xs: 0.75rem;
}

/* ============================================
   Base Styles
   ============================================ */

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

body {
    background: var(--background-light);
    font-family: var(--font-family-primary);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ============================================
   Chat Styles
   ============================================ */

.chat-container, .home-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    height: calc(100vh - 120px);
    gap: 10px;
}

.sidebar {
    width: 350px;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    background: var(--background-white);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.search-bar {
    margin-bottom: 20px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    background: var(--background-light);
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--background-white);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search-bar .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.search-bar .search-icon:hover {
    color: var(--primary-color);
}

.user-list, .friends-list {
    display: none;
}

.user-list.active, .friends-list.active {
    display: block;
}

.chats-list {
    display: block;
}

.chats-list.active {
    display: block;
}

.user-list h6, .friends-list h6, .chats-list h6 {
    margin: 10px 0;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-card {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: var(--transition);
    cursor: pointer;
    background: var(--background-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid transparent;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--hover-bg);
    border-color: var(--border-color);
}

.user-card.active {
    background: var(--message-sent);
    color: white;
    box-shadow: var(--shadow-md);
    border-color: var(--primary-dark);
}

.user-card .user-icon {
    font-size: 1.5rem;
    margin-right: 12px;
    color: var(--primary-color);
    transition: var(--transition);
}

.user-card.active .user-icon {
    color: white;
}

.user-card:hover .user-icon {
    color: var(--primary-dark);
}

.user-card.active:hover .user-icon {
    color: white;
}

.main-chat, .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--background-white);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: var(--shadow-sm);
}

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

.chat-header h5 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
}

.chat-header .dropdown-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    padding: 8px;
    border-radius: 8px;
}

.chat-header .dropdown-toggle:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
}

.message {
    margin-bottom: 15px;
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 10px;
    position: relative;
    word-wrap: break-word;
}

.message.sent {
    background: var(--message-sent);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.message.received {
    background: var(--message-received);
    color: var(--text-primary);
    margin-right: auto;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.message .timestamp {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 6px;
    text-align: right;
}

.message.sent .timestamp {
    color: rgba(255, 255, 255, 0.9);
}

.message.received .timestamp {
    color: var(--text-secondary);
}

.message .file-preview {
    margin-top: 10px;
}

.message .file-preview img {
    max-width: 200px;
    border-radius: 5px;
    display: block;
}

.message .file-preview a {
    color: var(--primary-light);
    text-decoration: none;
    word-break: break-all;
    font-weight: 500;
}

.message.received .file-preview a {
    color: var(--primary-color);
}

.chat-input {
    display: flex;
    align-items: center;
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: var(--background-white);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.chat-input form {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
}

.chat-input textarea {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    resize: none;
    font-size: 0.9rem;
    background: var(--background-light);
    transition: var(--transition);
}

.chat-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--background-white);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* ============================================
   Card Styles
   ============================================ */

.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px var(--card-shadow);
    padding: 20px;
    transition: var(--transition);
    background: var(--background-white);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--hover-shadow);
}

.stat-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    transition: var(--transition);
}

.stat-card:hover .card-icon {
    transform: scale(1.1);
    color: var(--primary-dark);
}

.stat-card h5 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stat-card .display-6 {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 2.5rem;
    margin: 0;
}

.card-link {
    text-decoration: none;
    color: inherit;
}

.card-link:hover .card {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--hover-shadow);
}

.card-link:hover .card-icon {
    transform: scale(1.1);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.card-stats {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.1rem;
}

.stat-value.pending {
    color: var(--warning-color);
}

.stat-value.total {
    color: var(--primary-color);
}

/* ============================================
   Button Styles
   ============================================ */

.btn-custom {
    border-radius: 15px;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-send {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-send:hover {
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-file {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-file:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-add, .btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-dark) 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2);
    border: none;
}

.btn-add:hover, .btn-success:hover {
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
    border: 2px solid;
    border-radius: var(--border-radius-sm);
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-add-appeal {
    border-color: var(--success-color);
    color: var(--success-color);
    border: 2px solid;
    border-radius: var(--border-radius-sm);
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    background-color: transparent;
}

.btn-add-appeal:hover {
    background-color: var(--success-color);
    color: white;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background-color: transparent;
    border: 2px solid;
    border-radius: var(--border-radius-sm);
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

/* ============================================
   Form Styles
   ============================================ */

.form-section {
    background: var(--background-white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px var(--card-shadow);
    border: 1px solid var(--border-color);
}

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

.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: var(--font-size-sm);
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

.form-control:hover, .form-select:hover {
    border-color: var(--primary-dark);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-top: 0.15rem;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

.form-check-label {
    font-size: var(--font-size-sm);
    color: var(--text-dark);
    margin-left: 10px;
    cursor: pointer;
}

/* ============================================
   Table Styles
   ============================================ */

.table {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--background-white);
}

.table th {
    background: var(--background-light);
    color: var(--text-dark);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table th, .table td {
    vertical-align: middle;
    font-size: 0.9rem;
    padding: 15px;
}

/* ============================================
   Badge Styles
   ============================================ */

.badge {
    padding: 0.4em 0.8em;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 8px;
}

.badge-success {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-dark) 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-dark) 100%);
    color: white;
}

/* ============================================
   Section Titles
   ============================================ */

.section-title, h2.section-title {
    color: var(--text-dark);
    font-weight: 700;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2rem;
}

h2 {
    color: var(--text-dark);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    text-align: center;
    margin-bottom: 40px;
}

/* ============================================
   Chart & Filter Styles
   ============================================ */

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    padding: 15px;
}

.filter-section {
    margin-bottom: 20px;
    text-align: right;
}

.filter-section select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-section select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-content {
    border-radius: var(--border-radius-lg);
    box-shadow: 0 5px 15px var(--hover-shadow);
    border: none;
    background-color: #fff;
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
    padding: 15px 20px;
    border-bottom: none;
}

.modal-title {
    font-weight: 700;
    font-size: 1.25rem;
}

.modal .btn-close {
    font-size: 1rem;
    color: white;
    opacity: 0.9;
    background: none;
    filter: invert(1);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal .btn-close:hover, .modal .btn-close:focus {
    opacity: 1;
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
}

/* ============================================
   Fixed Button Styles
   ============================================ */

.fixed-add-appeal-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
}

.fixed-add-appeal {
    background-color: transparent;
    border: 2px solid var(--success-color);
    color: var(--success-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 6px var(--card-shadow);
    transition: all 0.2s ease;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.fixed-add-appeal:hover {
    background-color: var(--success-color);
    color: white;
    transform: translateY(-2px);
}

.fixed-add-appeal:active {
    transform: scale(0.95);
}

/* ============================================
   Worker Card Styles
   ============================================ */

.worker-card {
    text-align: center;
    padding: 15px;
    min-height: 160px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.worker-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* ============================================
   Content Area Styles
   ============================================ */

.content-area {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.content-area h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.content-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    text-align: center;
    padding: 20px;
}

/* ============================================
   Status Styles
   ============================================ */

.status-pending {
    color: var(--warning-color);
    font-weight: bold;
}

.status-approved {
    color: var(--success-color);
    font-weight: bold;
}

.status-rejected {
    color: var(--danger-color);
    font-weight: bold;
}

.link-view {
    background: var(--primary-color);
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    margin-right: 5px;
    display: inline-block;
    transition: background-color 0.2s;
}

.link-respond {
    background: var(--success-color);
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    margin-right: 5px;
    display: inline-block;
    transition: background-color 0.2s;
}

.link-view:hover {
    background: var(--primary-dark);
    color: #fff;
}

.link-respond:hover {
    background: var(--success-dark);
    color: #fff;
}

/* ============================================
   Text Color Utilities
   ============================================ */

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ============================================
   Empty State Styles
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}

/* ============================================
   Container Styles
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-content {
    margin-left: 0;
    padding: 80px 20px 20px;
    min-height: 100vh;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 768px) {
    .chat-container, .home-container {
        flex-direction: column;
        height: calc(100vh - 100px);
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        border-radius: var(--border-radius) var(--border-radius) 0 0;
        max-height: 200px;
    }

    .main-chat, .main-content {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }

    .container {
        padding: 15px;
    }

    .card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .card-icon {
        font-size: 2.5rem;
    }

    .table th, .table td {
        font-size: 0.8rem;
    }

    .btn-custom {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .chart-container {
        height: 300px;
    }

    .filter-section {
        text-align: center;
    }

    .chat-input textarea {
        font-size: 0.8rem;
    }

    .chat-input .btn-custom {
        padding: 10px 15px;
        font-size: 0.8rem;
    }

    .message {
        max-width: 85%;
    }
}

@media (max-width: 576px) {
    .card-icon {
        font-size: 2rem;
    }

    .section-title, h2 {
        font-size: 1.5rem;
    }

    .table {
        font-size: 0.75rem;
    }

    .card {
        padding: 10px;
    }

    .chart-container {
        height: 250px;
    }

    .user-card .user-icon {
        font-size: 1.2rem;
    }

    .message {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .message .file-preview img {
        max-width: 150px;
    }

    .chat-input textarea, .chat-input .btn-custom {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

