/* Excel-like view styles for Event Task Manager */

.event-task-manager.excel-view {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Override WordPress theme restrictions */
.event-task-manager.excel-view * {
    box-sizing: border-box;
}

/* Override common WordPress theme max-width restrictions */
body .event-task-manager.excel-view {
    max-width: none !important;
    width: 100vw !important;
}

/* Ensure no parent containers restrict width */
.event-task-manager.excel-view {
    position: relative;
    z-index: 1;
}

/* Override any content area restrictions */
.content .event-task-manager.excel-view,
.entry-content .event-task-manager.excel-view,
.post-content .event-task-manager.excel-view,
.page-content .event-task-manager.excel-view {
    max-width: none !important;
    width: 100vw !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    left: 50% !important;
    right: 50% !important;
}

.excel-header {
    margin-bottom: 20px;
    text-align: left;
    padding: 0 20px;
}

.excel-header h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.excel-table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin: 0 10px;
}

.excel-table {
    width: 100%;
    min-width: 1200px; /* Ensure minimum width for proper display */
    border-collapse: collapse;
    margin: 0;
    background: #ffffff;
    font-size: 13px;
    table-layout: fixed; /* Fixed layout for better control */
}

/* Table Header */
.excel-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 10;
}

.excel-table thead th:last-child {
    border-right: none;
}

/* Column sizing - optimized for full width */
.col-task {
    width: 35%;
    min-width: 250px;
    text-align: left !important;
}

.col-time {
    width: 12%;
    min-width: 100px;
}

.col-participants {
    width: 13%;
    min-width: 110px;
}

.col-date {
    width: 6.5%;
    min-width: 70px;
}

.date-small {
    font-size: 9px;
    color: #6c757d;
    font-weight: normal;
}

/* Category Headers */
.category-header {
    background: #f8f9fa !important;
    border-top: 1px solid #dee2e6;
}

.category-header td {
    padding: 8px 8px 8px 32px; /* Increased left margin from 16px to 32px */
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #e5e7eb;
    font-size: 13px;
}

.category-name {
    font-size: 13px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.task-count {
    font-weight: normal;
    color: #6c757d;
    font-size: 11px;
    margin-left: 4px;
}

/* Task Rows */
.task-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.task-row:hover {
    background-color: #f8fafc;
}

.task-row td {
    padding: 8px 12px;
    border-right: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 13px;
}

.task-row td:last-child {
    border-right: none;
}

/* Alternate row styling for better readability */
.task-row:nth-child(even) {
    background-color: #fafbfc;
}

.task-row:nth-child(even):hover {
    background-color: #f1f3f4;
}

/* No-time tasks styling */
.no-time-task {
    background-color: #fff3cd;
}

.no-time-task:hover {
    background-color: #ffeaa7;
}

/* Task names */
.task-name {
    text-align: left;
}

.task-name.indented {
    padding-left: 24px;
}

.task-title {
    font-weight: 500;
    color: #212529;
    line-height: 1.3;
    font-size: 13px;
}

.no-time-task .task-title {
    color: #856404;
    font-weight: 600;
}

/* Time column */
.task-time {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #495057;
}

.task-time small {
    color: #6c757d;
    font-size: 10px;
}

/* Participants column */
.task-participants {
    text-align: center;
    font-size: 12px;
}

.participant-count {
    font-weight: 600;
    color: #28a745;
    font-size: 13px;
}

.unlimited {
    color: #6f42c1;
    font-weight: 600;
    font-size: 14px;
}

.unlimited small {
    font-size: 9px;
    color: #9575cd;
}

.task-participants small {
    color: #6c757d;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Status columns */
.task-status {
    text-align: center;
    padding: 6px 4px;
}

.assign-btn {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #28a745;
    color: white;
    cursor: pointer;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-family: Arial, sans-serif;
}

.assign-btn:hover {
    background: #1e7e34;
    transform: scale(1.1);
}

.status-full {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
}

.status-empty {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #ffffff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
}

.close {
    color: #9ca3af;
    float: right;
    font-size: 24px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.close:hover {
    color: #374151;
}

.modal h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.form-actions button[type="submit"] {
    background: #3b82f6;
    color: white;
}

.form-actions button[type="submit"]:hover {
    background: #2563eb;
}

.form-actions button[type="button"] {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.form-actions button[type="button"]:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .excel-table {
        min-width: 1000px;
    }
    
    .col-task {
        width: 30%;
        min-width: 200px;
    }
    
    .col-date {
        width: 8%;
        min-width: 60px;
    }
}

@media (max-width: 768px) {
    .event-task-manager.excel-view {
        margin-left: -50vw;
        margin-right: -50vw;
        width: 100vw;
    }
    
    .excel-table-container {
        margin: 0 5px;
    }
    
    .excel-header {
        padding: 0 10px;
    }
}

@media (min-width: 1400px) {
    .excel-table {
        min-width: 1400px;
    }
    
    .col-task {
        width: 40%;
    }
    
    .col-time {
        width: 10%;
    }
    
    .col-participants {
        width: 12%;
    }
    
    .col-date {
        width: 6%;
    }
}

/* Print Styles */
@media print {
    .assign-btn,
    .modal {
        display: none !important;
    }
    
    .excel-table-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .excel-table {
        font-size: 10px;
    }
    
    .task-row:hover {
        background-color: transparent !important;
    }
}
