/* Law Case Management System - Mobile-First Responsive Stylesheet */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Mobile Header Bar */
.mobile-header-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 0 1rem;
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.mobile-title i {
    color: #3b82f6;
    font-size: 1.25rem;
}

.mobile-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    padding-top: 0;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-close-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.mobile-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo i {
    font-size: 1.5rem;
    color: #3b82f6;
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: #3b82f6;
}

.nav-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
    color: #3b82f6;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    background-color: #f8fafc;
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-left h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    font-weight: 500;
    color: #64748b;
}

.notification-icon {
    position: relative;
    cursor: pointer;
}

.notification-icon i {
    font-size: 1.25rem;
    color: #64748b;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    min-width: 20px;
    text-align: center;
    display: none;
}

/* Content Area */
.content-area {
    padding: 2rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #64748b;
    font-weight: 500;
}

.dashboard-content {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.recent-activity h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.activity-icon.case {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.activity-icon.call {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.activity-icon.notification {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.activity-content h5 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.activity-content p {
    color: #64748b;
    font-size: 0.875rem;
}

.activity-time {
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Cases Grid */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.case-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.case-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.case-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.case-card-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.case-id {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.case-card-body {
    padding: 1.5rem;
}

.case-card-body p {
    margin-bottom: 0.75rem;
    color: #374151;
}

.case-card-body strong {
    color: #1e293b;
}

.case-card-footer {
    padding: 1rem 1.5rem;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.case-status {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: capitalize;
}

.case-status.open {
    background-color: #dbeafe;
    color: #1e40af;
}

.case-status.closed {
    background-color: #dcfce7;
    color: #166534;
}

.case-status.received {
    background-color: #fef3c7;
    color: #92400e;
}

.list-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* CALL FOR Form */
.call-for-form {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.call-for-form .form-group {
    margin-bottom: 1rem;
}

.call-for-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.call-for-form input,
.call-for-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.call-for-form input:focus,
.call-for-form select:focus {
    outline: none;
    border-color: #3b82f6;
}

.call-for-form button {
    margin-top: 1rem;
}

/* List Container */
.list-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
    flex-wrap: wrap;
    gap: 1rem;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background-color: #f8fafc;
}

.list-item-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.list-item-content p {
    color: #64748b;
    font-size: 0.875rem;
}

/* Mobile Notification Badge */
.mobile-sent-badge {
    display: inline-block;
    background-color: #10b981;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.empty-state h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #475569;
}

.empty-state p {
    color: #94a3b8;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

/* Messages */
.message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.message.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.message.error {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.message.info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Mobile Settings */
.mobile-settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.settings-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.settings-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-card h3 i {
    color: #3b82f6;
}

.info-content p {
    margin-bottom: 0.75rem;
    color: #374151;
}

.info-content strong {
    color: #1e293b;
}

.mobile-notification-types {
    margin-top: 1.5rem;
}

.mobile-notification-types h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.mobile-notification-types ul {
    list-style: none;
    padding: 0;
}

.mobile-notification-types li {
    padding: 0.5rem 0;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
}

.mobile-notification-types li:last-child {
    border-bottom: none;
}

/* Install Prompt */
.install-prompt {
    display: none;
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    z-index: 1001;
    padding: 1.5rem;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.install-content i {
    font-size: 2rem;
    color: #3b82f6;
}

.install-text {
    flex: 1;
    min-width: 200px;
}

.install-text h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.install-text p {
    color: #64748b;
    font-size: 0.875rem;
}

/* Utility Classes */
.desktop-only {
    display: inline;
}

/* Responsive Design - Mobile First */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .mobile-settings-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Mobile Header Bar */
    .mobile-header-bar {
        display: flex;
    }
    
    /* Adjust main content for mobile header */
    .app-container {
        padding-top: 60px;
    }
    
    /* Sidebar mobile behavior */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-close-btn {
        display: flex;
    }
    
    /* Main content full width on mobile */
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    /* Header adjustments */
    .header {
        padding: 1rem;
        margin-top: 60px;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    /* Dashboard stats single column */
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Cases grid single column */
    .cases-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Section headers stack on mobile */
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    /* Modal adjustments */
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        width: 100%;
        margin: 0;
        max-height: 95vh;
    }
    
    /* Form actions stack on mobile */
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile settings adjustments */
    .mobile-settings-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .settings-card {
        padding: 1.5rem;
    }
    
    /* Install prompt mobile adjustments */
    .install-prompt {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    
    .install-content {
        flex-direction: column;
        text-align: center;
    }
    
    .install-text {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    .case-card-header,
    .case-card-body,
    .case-card-footer {
        padding: 1rem;
    }
    
    .settings-card {
        padding: 1rem;
    }
    
    .settings-card h3 {
        font-size: 1.125rem;
    }
    
    .mobile-title span {
        display: none;
    }
    
    .mobile-title i {
        font-size: 1.5rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        padding: 1rem 1.5rem;
    }
    
    .nav-item {
        min-height: 48px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
    }
    
    .search-bar input {
        min-height: 44px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0f172a;
        color: #e2e8f0;
    }
    
    .header,
    .modal-content,
    .case-card,
    .settings-card,
    .list-container,
    .dashboard-content,
    .call-for-form {
        background-color: #1e293b;
        border-color: #334155;
    }
    
    .header-left h1,
    .section-header h2,
    .case-card-header h4,
    .list-item-content h4,
    .settings-card h3 {
        color: #e2e8f0;
    }
    
    .case-card-body p,
    .list-item-content p,
    .info-content p {
        color: #cbd5e1;
    }
    
    .search-bar input,
    .form-group input,
    .form-group select,
    .form-group textarea {
        background-color: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .mobile-header-bar,
    .header,
    .btn,
    .modal,
    .install-prompt {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .content-area {
        padding: 0 !important;
    }
    
    .case-card,
    .stat-card,
    .settings-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}

