/**
 * Project Management Tracker Styles
 * Matches the Arizona Candidate Tracker design system
 */

/* Reset and Base Styles */
.pmt-dashboard {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.pmt-dashboard * {
    box-sizing: border-box;
}

/* Header */
.pmt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.pmt-header h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
}

.pmt-header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.pmt-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pmt-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pmt-btn-primary {
    background: #3b82f6;
    color: white;
}

.pmt-btn-primary:hover {
    background: #2563eb;
}

.pmt-btn-secondary {
    background: #64748b;
    color: white;
}

.pmt-btn-secondary:hover {
    background: #475569;
}

.pmt-btn-danger {
    background: #ef4444;
    color: white;
}

.pmt-btn-danger:hover {
    background: #dc2626;
}

.pmt-btn-text {
    background: transparent;
    color: #64748b;
    padding: 10px 16px;
}

.pmt-btn-text:hover {
    background: #f1f5f9;
    transform: none;
    box-shadow: none;
}

.pmt-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Statistics Grid */
.pmt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pmt-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s ease;
}

.pmt-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.pmt-stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.pmt-stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.pmt-stat-card:nth-child(4) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.pmt-stat-card:nth-child(5) {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.pmt-stat-value {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1;
}

.pmt-stat-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.95;
    font-weight: 600;
}

/* Filters */
.pmt-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.pmt-filter-group {
    flex: 1;
    min-width: 180px;
}

/* Form Elements */
.pmt-input,
.pmt-select,
.pmt-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
}

.pmt-input:focus,
.pmt-select:focus,
.pmt-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pmt-textarea {
    resize: vertical;
    font-family: inherit;
}

/* Loading Indicator */
.pmt-loading {
    text-align: center;
    padding: 60px 20px;
}

.pmt-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Table */
.pmt-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.pmt-table {
    width: 100%;
    border-collapse: collapse;
}

.pmt-table thead {
    background: #f8fafc;
}

.pmt-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
}

.pmt-table th:hover {
    background: #f1f5f9;
}

.pmt-table th[data-sort]::after {
    content: ' ↕';
    opacity: 0.3;
}

.pmt-table th.sorted-asc::after {
    content: ' ↑';
    opacity: 1;
}

.pmt-table th.sorted-desc::after {
    content: ' ↓';
    opacity: 1;
}

.pmt-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.15s ease;
}

.pmt-table tbody tr:hover {
    background: #f9fafb;
}

.pmt-table td {
    padding: 16px;
    font-size: 14px;
    color: #1e293b;
}

.pmt-table td:last-child {
    white-space: nowrap;
}

/* Task Details in Table */
.pmt-task-desc {
    color: #666;
    font-size: 13px;
    margin-top: 5px;
}

.pmt-event-date {
    color: #666;
    font-size: 12px;
    margin-top: 3px;
}

.pmt-days-until {
    color: #666;
    font-size: 12px;
    margin-top: 3px;
    font-style: italic;
}

/* Badge Styles */
.pmt-badge {
    display: inline-block;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    width: 160px;
    text-align: center;
    height: 32px;
    line-height: 20px;
    box-sizing: border-box;
}

.pmt-status-select {
    width: 160px;
    height: 32px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    background: white;
    box-sizing: border-box;
}

.pmt-badge-not-started {
    background: #f0f0f1;
    color: #50575e;
}

.pmt-badge-in-progress {
    background: #fef8e7;
    color: #856404;
}

.pmt-badge-completed {
    background: #d4edda;
    color: #155724;
}

.pmt-badge-on-hold {
    background: #e7f3ff;
    color: #004085;
}

.pmt-badge-overdue {
    background: #f8d7da;
    color: #721c24;
}

.pmt-badge-waiting-on-others {
    background: #e8d5f0;
    color: #5a2d6e;
}

/* No Results */
.pmt-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.pmt-no-results p {
    font-size: 16px;
    margin: 0;
}

/* Modal */
.pmt-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(0,0,0,0.5);
}

.pmt-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.pmt-modal-large .pmt-modal-content {
    max-width: 900px;
}

.pmt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid #e5e7eb;
}

.pmt-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.pmt-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.pmt-modal-close:hover {
    background: #f3f4f6;
    color: #1e293b;
}

.pmt-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.pmt-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
}

/* Form Styles */
.pmt-form-group {
    margin-bottom: 20px;
}

.pmt-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.pmt-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Voice Input */
.pmt-voice-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.pmt-voice-input-wrapper .pmt-autocomplete-wrapper,
.pmt-voice-input-wrapper > input {
    flex: 1;
}

.pmt-voice-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pmt-voice-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.pmt-voice-btn.listening {
    background: #ef4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pmt-voice-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.pmt-voice-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Quick Add Voice Button */
.pmt-quick-voice-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
}

.pmt-quick-voice-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);
}

.pmt-quick-voice-btn.listening {
    background: #ef4444;
    animation: pulse 1.5s infinite;
}

.pmt-quick-voice-btn .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

@media (max-width: 768px) {
    .pmt-quick-voice-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}

/* Autocomplete */
.pmt-autocomplete-wrapper {
    position: relative;
}

.pmt-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pmt-autocomplete-dropdown.active {
    display: block;
}

.pmt-autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #1e293b;
    transition: background-color 0.15s ease;
}

.pmt-autocomplete-item:hover,
.pmt-autocomplete-item.selected {
    background: #f1f5f9;
}

.pmt-autocomplete-item.selected {
    background: #dbeafe;
    color: #1e40af;
}

.pmt-autocomplete-highlight {
    font-weight: 600;
    color: #3b82f6;
}

/* Events Grid */
.pmt-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pmt-event-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
}

.pmt-event-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.pmt-event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.pmt-event-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.pmt-event-date-badge {
    background: #3b82f6;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.pmt-event-description {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.pmt-event-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.pmt-event-stat {
    text-align: center;
}

.pmt-event-stat strong {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}

.pmt-event-stat span {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pmt-progress-bar {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.pmt-progress-fill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.3s ease;
}

.pmt-event-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pmt-event-actions .pmt-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

/* Icon Buttons */
.pmt-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
    background: transparent;
}

.pmt-icon-btn:hover {
    transform: translateY(-2px);
}

.pmt-icon-btn-view {
    color: #64748b;
}

.pmt-icon-btn-view:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.pmt-icon-btn-email {
    color: #3b82f6;
}

.pmt-icon-btn-email:hover {
    background: #dbeafe;
    color: #1e40af;
}

.pmt-icon-btn-edit {
    color: #3b82f6;
}

.pmt-icon-btn-edit:hover {
    background: #dbeafe;
    color: #1e40af;
}

.pmt-icon-btn-delete {
    color: #ef4444;
}

.pmt-icon-btn-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Detail View */
.pmt-detail-section {
    margin-bottom: 30px;
}

.pmt-detail-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.pmt-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.pmt-detail-item {
    margin-bottom: 12px;
}

.pmt-detail-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 4px;
}

.pmt-detail-value {
    font-size: 14px;
    color: #1e293b;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Dashboard container */
    .pmt-dashboard {
        padding: 0 10px;
        margin: 20px auto;
    }
    
    /* Header */
    .pmt-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .pmt-header h1 {
        font-size: 24px;
    }
    
    .pmt-header-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .pmt-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Statistics cards - stack to single column */
    .pmt-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .pmt-stat-card {
        padding: 16px;
    }
    
    .pmt-stat-value {
        font-size: 32px;
    }
    
    /* Filters - stack vertically */
    .pmt-filters {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }
    
    .pmt-filter-group {
        min-width: 100%;
    }
    
    /* Forms - single column */
    .pmt-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Tables - collapsed expandable list */
    .pmt-table-container {
        border-radius: 8px;
        box-shadow: none;
        overflow: visible;
    }
    
    .pmt-table {
        border: 0;
    }
    
    .pmt-table thead {
        display: none;
    }
    
    .pmt-table tbody tr {
        display: block;
        margin-bottom: 10px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: white;
        position: relative;
        cursor: pointer;
    }
    
    .pmt-table tbody tr:hover {
        background: #f9fafb;
    }
    
    /* Collapsed view - show only main info */
    .pmt-table td {
        display: none;
        padding: 8px 12px;
        border: none;
    }
    
    /* Always show these in collapsed view */
    .pmt-table td:nth-child(1), /* Task */
    .pmt-table td:nth-child(2), /* Event */
    .pmt-table td:nth-child(5), /* Status */
    .pmt-table td:nth-child(6)  /* Actions */
    {
        display: block;
    }
    
    /* Task name */
    .pmt-table td:nth-child(1) {
        padding: 12px 12px 8px 12px;
        font-weight: 600;
        font-size: 15px;
    }
    
    /* Event name */
    .pmt-table td:nth-child(2) {
        padding: 0 12px 8px 12px;
        font-size: 13px;
        color: #64748b;
    }
    
    /* Status */
    .pmt-table td:nth-child(5) {
        padding: 8px 12px;
    }
    
    /* Actions */
    .pmt-table td:nth-child(6) {
        padding: 8px 12px 12px 12px;
        border-top: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Expand indicator */
    .pmt-table td:nth-child(6)::before {
        content: "Tap to expand";
        font-size: 11px;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .pmt-table tbody tr.expanded td:nth-child(6)::before {
        content: "Tap to collapse";
    }
    
    /* Expanded state - show all fields */
    .pmt-table tbody tr.expanded td {
        display: block;
    }
    
    /* Add labels in expanded view */
    .pmt-table tbody tr.expanded td:nth-child(3)::before, /* Assigned To */
    .pmt-table tbody tr.expanded td:nth-child(4)::before  /* Due Date */
    {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 11px;
        color: #64748b;
        display: block;
        margin-bottom: 4px;
        letter-spacing: 0.5px;
    }
    
    .pmt-table tbody tr.expanded td:nth-child(3), /* Assigned To */
    .pmt-table tbody tr.expanded td:nth-child(4)  /* Due Date */
    {
        padding: 8px 12px;
        border-top: 1px solid #f1f5f9;
    }
    
    /* Description in task cell when expanded */
    .pmt-table tbody tr.expanded .pmt-task-desc {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #f1f5f9;
        font-size: 13px;
        color: #475569;
    }
    
    /* Remove hover status change on mobile */
    .pmt-table tbody tr.expanded .pmt-status-select {
        display: none !important;
    }
    
    .pmt-table tbody tr.expanded .pmt-badge {
        display: inline-block !important;
    }
    
    /* Status badge full width */
    .pmt-status-select {
        width: 100%;
        max-width: 200px;
    }
    
    /* Actions buttons */
    .pmt-icon-btn {
        width: 36px;
        height: 36px;
        margin: 0 4px;
    }
    
    .pmt-table td:nth-child(6) .pmt-icon-btn:first-of-type {
        margin-left: auto;
    }
    
    /* Modal adjustments */
    .pmt-modal {
        padding: 0;
        align-items: stretch;
    }
    
    .pmt-modal-content {
        max-width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .pmt-modal-large .pmt-modal-content {
        max-width: 100%;
    }
    
    .pmt-modal-header,
    .pmt-modal-body,
    .pmt-modal-footer {
        padding: 20px;
    }
    
    .pmt-modal-header h2 {
        font-size: 20px;
    }
    
    .pmt-modal-footer {
        flex-wrap: wrap;
    }
    
    .pmt-modal-footer .pmt-btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* Events grid - single column */
    .pmt-events-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pmt-event-card {
        padding: 16px;
    }
    
    .pmt-event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .pmt-event-header h3 {
        font-size: 18px;
    }
    
    .pmt-event-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .pmt-event-actions .pmt-btn {
        width: 100%;
        min-width: auto;
    }
    
    /* Voice button on mobile */
    .pmt-voice-btn {
        width: 42px;
        height: 42px;
    }
    
    /* No results */
    .pmt-no-results {
        padding: 40px 15px;
    }
    
    /* Loading */
    .pmt-loading {
        padding: 40px 15px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .pmt-header h1 {
        font-size: 20px;
    }
    
    .pmt-stat-value {
        font-size: 28px;
    }
    
    .pmt-stat-label {
        font-size: 12px;
    }
    
    .pmt-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    .pmt-modal-header h2 {
        font-size: 18px;
    }
    
    .pmt-event-header h3 {
        font-size: 16px;
    }
}

/* Utility Classes */
.pmt-hidden {
    display: none !important;
}

.pmt-text-center {
    text-align: center;
}

.pmt-font-bold {
    font-weight: 700;
}
