/**
 * CT Organizer Dashboard - Services Template Styles
 * Professional, modern styling for service browsing and request management
 */

/* ==========================================================================
   Services Wrapper & Layout
   ========================================================================== */

.ctod-services-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ctod-page-header {
    margin-bottom: 30px;
}

.ctod-page-header h1 {
    font-size: 32px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px 0;
}

.ctod-page-description {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

/* ==========================================================================
   Tab Navigation
   ========================================================================== */

.ctod-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.ctod-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #64748b;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
}

.ctod-tab:hover {
    color: #1e293b;
    background: #f8fafc;
}

.ctod-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: transparent;
}

.ctod-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ctod-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

/* ==========================================================================
   Browse Services - Grid Layout
   ========================================================================== */

.ctod-services-intro {
    margin-bottom: 30px;
}

.ctod-services-intro h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px 0;
}

.ctod-services-intro p {
    color: #64748b;
    font-size: 15px;
    margin: 0;
}

.ctod-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.ctod-service-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ctod-service-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.ctod-service-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.ctod-service-icon .dashicons {
    color: white;
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.ctod-service-content {
    flex: 1;
}

.ctod-service-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
}

.ctod-service-description {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.ctod-service-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.ctod-price-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.ctod-price {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
}

.ctod-service-actions {
    margin-top: auto;
}

/* ==========================================================================
   Requests List
   ========================================================================== */

.ctod-requests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.ctod-requests-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.ctod-requests-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ctod-requests-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ctod-request-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
}

.ctod-request-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Status-specific borders */
.ctod-request-item.ctod-status-pending {
    border-left: 4px solid #f59e0b;
}

.ctod-request-item.ctod-status-in_progress {
    border-left: 4px solid #3b82f6;
}

.ctod-request-item.ctod-status-revision_requested {
    border-left: 4px solid #8b5cf6;
}

.ctod-request-item.ctod-status-completed {
    border-left: 4px solid #10b981;
}

.ctod-request-item.ctod-status-cancelled {
    border-left: 4px solid #6b7280;
}

.ctod-request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

.ctod-request-title-section {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex: 1;
}

.ctod-request-title-section .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #3b82f6;
    flex-shrink: 0;
    margin-top: 2px;
}

.ctod-request-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.ctod-request-event {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.ctod-request-event strong {
    color: #1e293b;
}

/* Status Badges */
.ctod-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.ctod-status-badge.ctod-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.ctod-status-badge.ctod-status-in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.ctod-status-badge.ctod-status-revision_requested {
    background: #ede9fe;
    color: #5b21b6;
}

.ctod-status-badge.ctod-status-completed {
    background: #d1fae5;
    color: #065f46;
}

.ctod-status-badge.ctod-status-cancelled {
    background: #f3f4f6;
    color: #374151;
}

/* Request Body Content */
.ctod-request-body {
    margin-bottom: 20px;
}

.ctod-request-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    flex-wrap: wrap;
}

.ctod-meta-item {
    display: flex;
    gap: 8px;
    font-size: 13px;
}

.ctod-meta-label {
    color: #64748b;
    font-weight: 500;
}

.ctod-meta-value {
    color: #1e293b;
    font-weight: 600;
}

.ctod-request-details,
.ctod-request-notes {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.ctod-request-details h4,
.ctod-request-notes h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.ctod-request-details p,
.ctod-request-notes p {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

.ctod-request-notes {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

/* Deliverables */
.ctod-request-deliverables {
    margin-top: 16px;
    padding: 16px;
    background: #f0fdf4;
    border-radius: 8px;
    border-left: 3px solid #10b981;
}

.ctod-request-deliverables h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
}

.ctod-deliverables-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ctod-deliverable-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.ctod-deliverable-item:hover {
    background: #f8fafc;
}

.ctod-deliverable-item .dashicons {
    color: #10b981;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ctod-deliverable-item a {
    color: #1e293b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.ctod-deliverable-item a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.ctod-file-size {
    font-size: 12px;
    color: #94a3b8;
}

/* Request Actions */
.ctod-request-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.ctod-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
}

.ctod-empty-state .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.ctod-empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.ctod-empty-state p {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 24px 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.ctod-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.ctod-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

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

.ctod-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.ctod-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.ctod-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.ctod-btn-success {
    background: #10b981;
    color: white;
}

.ctod-btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

.ctod-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.ctod-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}
/* ==========================================================================
   Modal Styles - Centered on Page
   Add this to your services.css file or replace the modal section
   ========================================================================== */

.ctod-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Padding for mobile */
}

.ctod-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.ctod-modal-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    margin: auto; /* Extra centering */
    overflow: hidden; /* Clean edges */
}

.ctod-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.ctod-modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.ctod-modal-close {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
    line-height: 1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctod-modal-close:hover {
    color: #1e293b;
    background: #e2e8f0;
}

.ctod-modal-close .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.ctod-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.ctod-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

/* Modal Animation */
.ctod-modal {
    animation: modalFadeIn 0.2s ease-out;
}

.ctod-modal-container {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Responsive Design for Modals */
@media (max-width: 768px) {
    .ctod-modal {
        padding: 10px;
    }
    
    .ctod-modal-container {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .ctod-modal-header,
    .ctod-modal-body,
    .ctod-modal-footer {
        padding: 20px;
    }
    
    .ctod-modal-header h2 {
        font-size: 18px;
    }
    
    .ctod-modal-footer {
        flex-direction: column;
    }
    
    .ctod-modal-footer .ctod-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .ctod-modal {
        padding: 5px;
    }
    
    .ctod-modal-container {
        border-radius: 8px;
    }
    
    .ctod-modal-header,
    .ctod-modal-body {
        padding: 16px;
    }
}

/* Ensure modal displays as flex when shown */
.ctod-modal[style*="display: flex"],
.ctod-modal[style*="display:flex"] {
    display: flex !important;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.ctod-form-group {
    margin-bottom: 20px;
}

.ctod-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.ctod-input,
.ctod-select,
.ctod-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: white;
    transition: all 0.2s ease;
}

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

.ctod-input:disabled,
.ctod-select:disabled,
.ctod-textarea:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

.ctod-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

.ctod-field-description {
    font-size: 13px;
    color: #64748b;
    margin: 6px 0 0 0;
    line-height: 1.4;
}

/* File Upload Area */
.ctod-file-upload-area {
    margin-top: 8px;
}

.ctod-file-input {
    display: none;
}

.ctod-file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.ctod-file-label:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.ctod-file-label .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.ctod-file-label span {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.ctod-file-label small {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.ctod-file-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ctod-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.ctod-file-item .dashicons {
    color: #3b82f6;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ctod-file-name {
    flex: 1;
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
}

.ctod-file-item .ctod-file-size {
    font-size: 12px;
    color: #94a3b8;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.dashicons-update.dashicons-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .ctod-services-wrapper {
        padding: 16px;
    }
    
    .ctod-page-header h1 {
        font-size: 24px;
    }
    
    .ctod-services-grid {
        grid-template-columns: 1fr;
    }
    
    .ctod-requests-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ctod-requests-filters {
        width: 100%;
    }
    
    .ctod-requests-filters .ctod-select {
        flex: 1;
        min-width: 0;
    }
    
    .ctod-request-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ctod-request-actions {
        width: 100%;
    }
    
    .ctod-request-actions .ctod-btn {
        flex: 1;
        justify-content: center;
    }
    
    .ctod-modal-container {
        max-height: 95vh;
        margin: 10px;
    }
    
    .ctod-modal-footer {
        flex-direction: column;
    }
    
    .ctod-modal-footer .ctod-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .ctod-tabs {
        flex-direction: column;
    }
    
    .ctod-tab {
        width: 100%;
        justify-content: center;
    }
    
    .ctod-request-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ctod-tabs,
    .ctod-requests-filters,
    .ctod-request-actions,
    .ctod-btn {
        display: none !important;
    }
    
    .ctod-request-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}