/* Apex Development Dashboard Styles */

/* Base Variables */
:root {
    --primary-color: #2c5aa0;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-gray: #f8fafc;
    --medium-gray: #e2e8f0;
    --dark-gray: #475569;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --white: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
#apex-development-dashboard * {
    box-sizing: border-box;
}

#apex-development-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    position: relative;
}

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 2rem 1.5rem;
    text-align: center;
}

.dashboard-header h2 {
    margin: 0 0 1.5rem 0;
    font-size: 2rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--accent-color);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dashboard Filters */
.dashboard-filters {
    background: var(--white);
    padding: 1.5rem;
    border-bottom: 1px solid var(--medium-gray);
}

/* Prominent Search Section */
.search-section {
    background: linear-gradient(135deg, rgba(44, 90, 160, 0.05) 0%, rgba(30, 64, 175, 0.08) 100%);
    border: 2px solid rgba(44, 90, 160, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.search-container {
    display: flex;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto 0.75rem auto;
    align-items: stretch;
}

.search-input-prominent {
    flex: 1;
    min-width: 0;
    padding: 12px 1.25rem;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    border: 3px solid var(--primary-color);
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--transition);
    background: var(--white);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.15);
}

.search-input-prominent:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(44, 90, 160, 0.2), 0 4px 12px rgba(44, 90, 160, 0.25);
    transform: translateY(-1px);
}

.search-input-prominent::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

.btn-search {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 1rem 1.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
    transition: var(--transition);
    min-width: 100px;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 90, 160, 0.4);
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

.search-hint {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Secondary Filters */
.secondary-filters {
    border-top: 1px solid var(--medium-gray);
    padding-top: 1.5rem;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.filter-group:last-child {
    margin-bottom: 0;
}

/* Legacy search input for backwards compatibility */
.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 8px 15px rgba(44, 90, 160, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-primary);
    border: 2px solid var(--medium-gray);
}

.btn-secondary:hover {
    background: var(--light-gray);
    border-color: var(--primary-color);
}

.btn-secondary.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

/* Dashboard Content */
.dashboard-content {
    min-height: 400px;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative;
}

.view-panel {
    display: none;
    padding: 1.5rem;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.view-panel.active {
    display: block;
}

/* Fix parent container height issues */
#apex-development-dashboard {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

#list-view {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Projects Grid */
.projects-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 1.5rem !important;
    margin-bottom: 2rem !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* Project Card */
.project-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--medium-gray);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

/* New full-width status at top */
.project-status-full {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

.project-status-full.status-approved {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.project-status-full.status-under-construction {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.project-status-full.status-proposed {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.project-status-full.status-withdrawn {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* New full-width type */
.project-type-full {
    background: var(--light-gray);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    width: 100%;
    border: 1px solid var(--medium-gray);
}

/* New full-width title */
.project-title-full {
    font-size: 17px !important;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.1 !important;
    text-align: center;
    padding: 0.5rem;
    background: rgba(44, 90, 160, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(44, 90, 160, 0.1);
}

/* Extra specificity for WordPress theme overrides */
#apex-development-dashboard .project-card h3.project-title-full {
    font-size: 17px !important;
    line-height: 1.1 !important;
    font-family: inherit !important;
}

/* Even more specific override */
.project-card .project-title-full,
.projects-grid .project-title-full {
    font-size: 17px !important;
    line-height: 1.1 !important;
}

/* New bottom row with half-width details */
.project-bottom-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: auto; /* Push to bottom of card */
    padding-top: 1rem;
    border-top: 1px solid var(--medium-gray);
}

.project-detail-half {
    text-align: center;
    background: var(--light-gray);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--medium-gray);
}

.project-detail-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.project-detail-value {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Legacy classes for backwards compatibility - keep for modals */
.project-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-approved {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-under-construction {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-proposed {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-withdrawn {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.project-type {
    display: inline-block;
    background: var(--light-gray);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--medium-gray);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Pagination removed - using infinite scroll instead */

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--medium-gray);
    background: var(--light-gray);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    background: var(--medium-gray);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* Map Container */
#map-container {
    height: 500px;
    background: var(--medium-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

#mapbox-map {
    height: 100%;
    width: 100%;
    border-radius: var(--border-radius);
}

/* Mapbox popup styling */
.mapbox-popup {
    font-family: inherit !important;
}

.mapboxgl-popup-content {
    border-radius: var(--border-radius) !important;
    padding: 0 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

.mapboxgl-popup-tip {
    border-top-color: white !important;
}

/* Status badge styling for map popups */
.status-badge.status-approved {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
}

.status-badge.status-under-construction {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
}

.status-badge.status-proposed {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
}

.status-badge.status-withdrawn {
    background: rgba(107, 114, 128, 0.15) !important;
    color: #6b7280 !important;
}

/* Mapbox controls styling */
.mapboxgl-ctrl-group {
    border-radius: var(--border-radius) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.mapboxgl-ctrl-group button {
    background: white !important;
    border: none !important;
}

.mapboxgl-ctrl-group button:hover {
    background: var(--light-gray) !important;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .dashboard-header {
        padding: 1.5rem 1rem;
    }
    
    .dashboard-header h2 {
        font-size: 1.5rem;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.75rem 0.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .dashboard-filters {
        padding: 1rem;
    }
    
    /* Mobile Search Prominence */
    .search-section {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
        border-width: 3px;
        background: linear-gradient(135deg, rgba(44, 90, 160, 0.08) 0%, rgba(30, 64, 175, 0.12) 100%);
        box-shadow: 0 8px 25px rgba(44, 90, 160, 0.15);
    }
    
    .search-container {
        flex-direction: column;
        gap: 1rem;
        max-width: none;
    }
    
    .search-input-prominent {
        padding: 12px 1.5rem;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
        font-size: 1.2rem;
        border-width: 4px;
        border-radius: 50px;
        box-shadow: 0 6px 20px rgba(44, 90, 160, 0.2);
        text-align: center;
    }
    
    .search-input-prominent:focus {
        box-shadow: 0 0 0 5px rgba(44, 90, 160, 0.25), 0 8px 25px rgba(44, 90, 160, 0.3);
        transform: translateY(-2px);
    }
    
    .btn-search {
        padding: 1.25rem 2rem;
        font-size: 1.2rem;
        border-radius: 50px;
        box-shadow: 0 6px 20px rgba(44, 90, 160, 0.35);
        min-width: auto;
        width: 100%;
        font-weight: 700;
    }
    
    .btn-search:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(44, 90, 160, 0.45);
    }
    
    .search-hint {
        font-size: 1rem;
        margin-top: 0.5rem;
        font-weight: 500;
        color: var(--primary-color);
    }
    
    /* Secondary filters less prominent on mobile */
    .secondary-filters {
        background: rgba(248, 250, 252, 0.8);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-toggle {
        flex-direction: row;
        margin-left: 0;
    }
    
    .view-panel {
        padding: 1rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .project-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .project-status-full {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .project-type-full {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .project-title-full {
        font-size: 15px !important;
        line-height: 1.1 !important;
        padding: 0.4rem;
    }
    
    /* Extra mobile specificity */
    #apex-development-dashboard .project-card h3.project-title-full {
        font-size: 15px !important;
        line-height: 1.1 !important;
    }
    
    .project-bottom-details {
        gap: 0.75rem;
    }
    
    .project-detail-half {
        padding: 0.5rem;
    }
    


    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    #map-container {
        height: 300px;
    }
}



@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .stat-number {
        font-size: 1.25rem;
        margin-bottom: 0;
    }
    
    /* Enhanced search for smallest screens */
    .search-section {
        padding: 2.5rem 0.75rem;
        margin: 0 -0.25rem 2rem -0.25rem;
        border-radius: 16px;
        box-shadow: 0 12px 35px rgba(44, 90, 160, 0.2);
    }
    
    .search-input-prominent {
        padding: 12px 1.75rem;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
        font-size: 1.3rem;
        border-width: 4px;
        font-weight: 600;
    }
    
    .btn-search {
        padding: 1.5rem 2.5rem;
        font-size: 1.3rem;
        font-weight: 800;
        letter-spacing: 1px;
    }
    
    .search-hint {
        font-size: 1.1rem;
        font-weight: 600;
        margin-top: 0.75rem;
    }
    
    .filter-select,
    .search-input {
        min-width: unset;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Compact secondary filters on smallest screens */
    .secondary-filters {
        padding: 0.75rem;
        border-radius: 6px;
    }
    
    .filter-select {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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