/**
 * Alect Void Tracker Pro - Custom Styles
 * Replace these CSS variables with Alect brand colors
 */

:root {
    /* Alect Brand Colors - Update these with actual brand colors */
    --alect-primary: #2c3e50;
    --alect-secondary: #34495e;
    --alect-accent: #3498db;
    --alect-success: #27ae60;
    --alect-warning: #f39c12;
    --alect-danger: #e74c3c;

    /* Status Colors */
    --status-active: #27ae60;
    --status-completed: #7f8c8d;
    --status-paused: #f39c12;
}

/* General Body Styles */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar Customization */
.navbar-dark.bg-dark {
    background-color: var(--alect-primary) !important;
}

.navbar-brand {
    font-weight: 600;
}

.nav-link.active {
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 8px;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

/* Dashboard Stats */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

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

.stat-card .stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.stat-active .stat-value { color: var(--status-active); }
.stat-card.stat-warning .stat-value { color: var(--alect-warning); }
.stat-card.stat-info .stat-value { color: var(--alect-accent); }

/* Table Styles */
.table-voids th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6c757d;
}

.table-voids td {
    vertical-align: middle;
}

/* Status Badges */
.badge-status {
    font-weight: 500;
    padding: 0.4em 0.8em;
    font-size: 0.75rem;
}

.badge-active {
    background-color: var(--status-active);
}

.badge-completed {
    background-color: var(--status-completed);
}

.badge-paused {
    background-color: var(--status-paused);
}

/* Days Display */
.days-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.days-actual {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--alect-primary);
}

.days-total {
    color: #95a5a6;
    font-size: 0.85rem;
}

.days-paused {
    color: var(--alect-warning);
    font-size: 0.75rem;
}

/* Clock Control */
.clock-control {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

.clock-running {
    background-color: #e8f5e9;
    color: var(--status-active);
}

.clock-stopped {
    background-color: #fff3e0;
    color: var(--alect-warning);
}

/* Action Buttons */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.btn-group-actions {
    gap: 0.25rem;
}

/* Form Styles */
.form-label {
    font-weight: 500;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--alect-accent);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Void Detail Page */
.void-header {
    background: linear-gradient(135deg, var(--alect-primary) 0%, var(--alect-secondary) 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.void-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.void-header .address {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Linked Jobs */
.linked-job-badge {
    background-color: var(--alect-accent);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.child-job-row {
    background-color: #f8f9fa;
}

.child-job-row td:first-child {
    padding-left: 2rem;
}

.child-job-row td:first-child::before {
    content: '\2514';
    margin-right: 0.5rem;
    color: #adb5bd;
}

/* Pause History */
.pause-timeline {
    position: relative;
    padding-left: 2rem;
}

.pause-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e9ecef;
}

.pause-item {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.pause-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--alect-warning);
    border: 2px solid white;
}

.pause-item.active::before {
    background-color: var(--status-paused);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(243, 156, 18, 0); }
    100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0); }
}

/* Notes Timeline */
.notes-timeline {
    max-height: 400px;
    overflow-y: auto;
}

.note-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--alect-accent);
}

.note-item:last-child {
    margin-bottom: 0;
}

.note-content {
    color: #333;
    line-height: 1.5;
}

.note-meta {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

/* Comments / Discussion */
.comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    font-size: 0.9rem;
}

.comment-header {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-body {
    color: #333;
    line-height: 1.6;
}

.comment-actions .btn-link {
    text-decoration: none;
}

.comment-actions .btn-link:hover {
    text-decoration: underline;
}

.comment-replies {
    border-left: 2px solid #e9ecef;
    margin-left: 0;
    padding-left: 1rem;
}

.comment-replies .comment-item {
    padding: 0.75rem 0;
}

.comment-replies .comment-avatar {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    font-size: 0.75rem;
}

#addCommentForm textarea {
    resize: none;
}

#replyIndicator {
    font-size: 0.875rem;
}

/* Filter Bar */
.filter-bar {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* View Toggle */
.view-toggle .btn {
    border-radius: 0;
}

.view-toggle .btn:first-child {
    border-radius: 4px 0 0 4px;
}

.view-toggle .btn:last-child {
    border-radius: 0 4px 4px 0;
}

/* DataTables Overrides */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_info {
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 1.75rem;
    }

    .stat-card .stat-label {
        font-size: 0.75rem;
    }

    .void-header {
        padding: 1rem;
    }

    .void-header h1 {
        font-size: 1.25rem;
    }

    .void-header .address {
        font-size: 0.9rem;
    }

    .table-voids {
        font-size: 0.85rem;
    }

    .table-voids th {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }

    .table-voids td {
        padding: 0.5rem 0.25rem;
    }

    .filter-bar {
        padding: 0.75rem;
    }

    .filter-bar .form-control,
    .filter-bar .form-select,
    .filter-bar .btn {
        font-size: 0.85rem;
    }

    /* Stack filter buttons on mobile */
    .filter-bar .view-toggle {
        flex-wrap: wrap;
    }

    .filter-bar .view-toggle .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Dashboard alerts - make tables scroll */
    .card-body .table-responsive {
        max-height: 200px;
        overflow-y: auto;
    }

    /* Navbar adjustments */
    .navbar-brand {
        font-size: 0.95rem;
    }

    .navbar-brand img {
        height: 24px !important;
    }

    /* Action buttons on mobile */
    .btn-group-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .btn-group-actions .btn {
        width: 100%;
    }

    /* Days display compact on mobile */
    .days-display {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    /* Notes timeline compact */
    .notes-timeline {
        max-height: 300px;
    }

    .note-item {
        padding: 0.5rem;
    }

    /* Report sections compact */
    .copy-section {
        padding: 1rem !important;
    }

    /* Quick actions full width */
    .d-flex.gap-2 {
        flex-direction: column;
    }

    .d-flex.gap-2 .btn {
        width: 100%;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .card-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    /* Hide non-essential columns on very small screens */
    .table-voids .hide-mobile {
        display: none;
    }

    /* Breadcrumb compact */
    .breadcrumb {
        font-size: 0.8rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .filter-bar,
    .btn-action,
    footer {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
