/* Crew & Job Management - Main Stylesheet */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    
    --sidebar-width: 260px;
    --header-height: 70px;
    
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --bg-light: #ecf0f1;
    --bg-white: #ffffff;
    --border-color: #ddd;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary-color);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-logo {
    max-width: 150px;
    height: auto;
}

.sidebar-header h2 {
    font-size: 20px;
    margin: 0;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 5px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-link i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 20px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
}

.user-info {
    text-align: center;
}

.user-info small {
    display: block;
    opacity: 0.7;
    font-size: 11px;
}

.user-info strong {
    display: block;
    margin: 5px 0;
}

.user-role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.role-admin {
    background: #e74c3c;
}

.role-manager {
    background: #f39c12;
}

.role-user {
    background: #3498db;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

/* Notifications */
.notification-dropdown {
    position: relative;
}

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 350px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    max-height: 500px;
    overflow: hidden;
    flex-direction: column;
}

.notification-panel.show {
    display: flex;
}

.notification-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    font-size: 16px;
    margin: 0;
}

.notification-list {
    overflow-y: auto;
    max-height: 400px;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    transition: background 0.3s;
}

.notification-item:hover {
    background: var(--bg-light);
}

.notification-item.unread {
    background: #e3f2fd;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.info { background: #e3f2fd; color: var(--info-color); }
.notification-icon.success { background: #e8f5e9; color: var(--success-color); }
.notification-icon.warning { background: #fff3e0; color: var(--warning-color); }
.notification-icon.error { background: #ffebee; color: var(--danger-color); }

.notification-content {
    flex: 1;
}

.notification-content strong {
    display: block;
    margin-bottom: 5px;
}

.notification-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.notification-time {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 5px;
}

.no-notifications {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 25px;
    transition: background 0.3s;
}

.user-btn:hover {
    background: var(--bg-light);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-name {
    font-weight: 500;
}

.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    display: none;
}

.user-menu.show {
    display: block;
}

.user-menu-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-menu-header strong {
    display: block;
    margin-bottom: 5px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.3s;
}

.user-menu a:hover {
    background: var(--bg-light);
}

.user-menu hr {
    margin: 5px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 30px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.blue { background: var(--primary-color); }
.stat-icon.green { background: var(--success-color); }
.stat-icon.purple { background: #9b59b6; }
.stat-icon.orange { background: var(--warning-color); }

.stat-content h3 {
    font-size: 32px;
    margin: 0;
    font-weight: 700;
}

.stat-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* Job List */
.job-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.job-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.job-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.job-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.job-info h4 a {
    color: var(--text-dark);
    text-decoration: none;
}

.job-info h4 a:hover {
    color: var(--primary-color);
}

.job-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-planning { background: #e3f2fd; color: #1976d2; }
.status-scheduled { background: #fff3e0; color: #f57c00; }
.status-in_progress { background: #e8f5e9; color: #388e3c; }
.status-completed { background: #f3e5f5; color: #7b1fa2; }
.status-cancelled { background: #ffebee; color: #c62828; }

/* Schedule List */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.schedule-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s;
}

.schedule-item:hover {
    box-shadow: var(--shadow-sm);
}

.schedule-date {
    text-align: center;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    min-width: 60px;
}

.date-day {
    font-size: 24px;
    font-weight: bold;
}

.date-month {
    font-size: 12px;
    text-transform: uppercase;
}

.schedule-info h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
}

.schedule-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s;
    text-align: center;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 32px;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 8px;
    display: flex;
    align-items: center;
}

.activity-icon i {
    font-size: 8px;
    color: var(--primary-color);
}

.activity-content p {
    margin: 0;
    font-size: 14px;
}

.activity-content small {
    color: var(--text-muted);
    font-size: 12px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #34495e;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px 10px;
    font-size: 13px;
}

/* Quickstart Guide */
.quickstart-guide {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 10px;
    margin-top: 30px;
}

.quickstart-header {
    text-align: center;
    margin-bottom: 40px;
}

.quickstart-header h2 {
    margin-bottom: 10px;
}

.quickstart-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    background: white;
    color: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 20px;
}

.step h3 {
    margin-bottom: 10px;
}

.step p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.step .btn {
    background: white;
    color: #667eea;
}

/* Footer */
.app-footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 20px 30px;
    text-align: center;
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted);
}

/* Responsive Styles */

/* Mobile hamburger menu */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.mobile-menu-toggle i {
    font-size: 20px;
}

/* Mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* Tablet - iPad (768px - 1024px) */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .tab-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-button {
        white-space: nowrap;
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Mobile - Phone (max 768px) */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .content-wrapper {
        padding: 70px 15px 15px;
    }
    
    .page-header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .btn-group {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .btn i {
        font-size: 13px;
    }
    
    /* Tabs */
    .tab-navigation {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }
    
    .tab-button {
        font-size: 13px;
        padding: 10px 12px;
        min-width: auto;
        white-space: nowrap;
    }
    
    .tab-button i {
        display: none;
    }
    
    /* Stats Grid */
    .stats-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    /* Forms */
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group-full {
        grid-column: 1;
    }
    
    /* Tables - Make scrollable instead of hiding columns */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        font-size: 13px;
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 5px;
        white-space: nowrap;
    }
    
    /* Cards */
    .card {
        padding: 15px;
    }
    
    .card-header {
        font-size: 16px;
        padding: 12px 15px;
    }
    
    /* Job cards grid */
    .jobs-grid {
        grid-template-columns: 1fr;
    }
    
    /* Files grid */
    .files-grid {
        grid-template-columns: 1fr;
    }
    
    /* Comments */
    .comment-item {
        flex-direction: column;
    }
    
    .comment-avatar {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Calendar */
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        font-size: 12px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 3px;
    }
    
    .calendar-day-number {
        font-size: 12px;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Footer */
    .app-footer {
        padding: 15px;
        font-size: 13px;
    }
}

/* Small mobile (max 480px) */
@media (max-width: 480px) {
    .content-wrapper {
        padding: 60px 10px 10px;
    }
    
    .page-header h1 {
        font-size: 18px;
    }
    
    .btn {
        font-size: 12px;
        padding: 7px 10px;
    }
    
    .tab-button {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 3px;
    }
    
    /* Show only first 3 columns */
    .data-table th:nth-child(n+4),
    .data-table td:nth-child(n+4) {
        display: none;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 14px;
    }
}
