/* ========================================
   SERVICES PAGE - REFINED LAYOUT
   Matches Gallery Page Design Pattern
======================================== */

/* ========================================
   SERVICES PAGE SECTION
======================================== */
.services-page-section {
    min-height: 100vh;
    padding: 140px 5% 80px;
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    overflow: hidden;
    position: relative;
}

/* ========================================
   SERVICES PAGE HEADER
======================================== */
.services-page-header {
    text-align: center;
    margin-bottom: 60px;
    color: white;
}

.services-page-header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a8b3cf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.services-page-header p {
    font-size: 16px;
    line-height: 1.8;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* ========================================
   SERVICES FILTER SECTION
======================================== */
.services-filter-section {
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

/* Search Bar */
.search-bar-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    pointer-events: none;
}

.service-search-input {
    width: 100%;
    padding: 16px 55px 16px 55px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.service-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.service-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
}

.clear-search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.clear-search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

/* Category Filter Tabs */
.category-filter-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-tab.active {
    background: #4f46e5;
    border-color: #4f46e5;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.filter-count {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.filter-tab.active .filter-count {
    background: rgba(0, 0, 0, 0.3);
}

/* Additional Filters */
.additional-filters {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.filter-checkbox:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.filter-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4f46e5;
}

.reset-filters-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reset-filters-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

/* Results Info */
.results-info {
    text-align: center;
    margin-bottom: 20px;
}

.results-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 500;
}

/* ========================================
   SERVICES CONTAINER & CARDS
======================================== */
.services-page-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px;
    padding-bottom: 60px;
}

.service-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 35px 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.service-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Service Icon */
.service-icon {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.15);
}

.service-icon img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
    line-height: 1.3;
}

.service-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 25px;
    flex: 1;
}

.learn-more-btn {
    margin-top: auto;
    padding: 12px 28px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   BADGES
======================================== */
.offer-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    animation: pulse 2s infinite;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.featured-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

/* ========================================
   SERVICE MODAL POPUP
======================================== */
.service-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.service-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark overlay behind modal */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

/* Modal Content Container */
.modal-content {
    position: relative;
    width: 95%;
    max-width: 1300px;
    max-height: 90vh;
    background: linear-gradient(135deg, #3f8f65 0%, #122256 100%);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: #ef4444;
    transform: rotate(90deg);
}

/* Modal Body - Two Column Layout */
.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 90vh;              /* FIX */
    max-height: 90vh;
    overflow: hidden;
}


/* LEFT SIDE: Description */
.modal-left {
    padding: 60px 50px;
    color: white;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Custom Scrollbar for left side */
.modal-left::-webkit-scrollbar {
    width: 10px;
}

.modal-left::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.modal-left::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.modal-left::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Modal Header Inside */
.modal-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 10px;
    line-height: 1.2;
}

.service-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Modal Description */
.modal-description h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    margin-top: 10px;
}

.modal-description h4 {
    font-size: 1.2rem;
    margin-top: 25px;
    margin-bottom: 12px;
}

.modal-description p {
    font-size: 15px;
    line-height: 1.8;
    opacity: 0.95;
    margin-bottom: 15px;
}

.modal-description ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.modal-description ul li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.95;
}

.modal-description ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

/* RIGHT SIDE: Image */
.modal-right {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;          /* CRITICAL */
}

.modal-image-wrapper {
    flex: 1 1 auto;          /* Takes remaining space */
    min-height: 0;           /* Required for overflow to work */
    padding: 30px;
    overflow: hidden;
    position: relative;
}

.modal-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}


.modal-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 40px 30px;
    color: white;
}

.modal-right-footer {
    flex-shrink: 0;          /* Never collapse */
    padding: 0 28px 10px;     /* 5px left & right space */
}

.modal-right-footer .btn {
    width: 100%;             /* FULL WIDTH */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
    font-size: 16px;
    border-radius: 12px;
}


.overlay-content {
    text-align: center;
}

.overlay-content i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.overlay-content h3 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.overlay-content p {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.6;
}

/* Modal Stats */
.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 20px;
    color: white;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Modal Offer Badge */
.modal-offer-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    margin-top: 10px;
    animation: pulse 2s infinite;
}

/* ========================================
   PAGINATION
======================================== */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 50px;
    padding: 20px;
}

.pagination-btn {
    padding: 12px 24px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-number {
    width: 42px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-number:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.pagination-number.active {
    background: #4f46e5;
    border-color: #4f46e5;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.5);
}

.pagination-ellipsis {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    padding: 0 5px;
}

/* ========================================
   LOADING & EMPTY STATES
======================================== */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: white;
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: 500;
}

.empty-state,
.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    color: white;
}

.empty-state h3,
.error-state h3 {
    font-size: 1.8rem;
    margin: 20px 0 10px;
}

.empty-state p,
.error-state p {
    font-size: 15px;
    opacity: 0.8;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 750px) {
    .services-page-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
    }
    
    .category-filter-tabs {
        gap: 10px;
    }
    
    .filter-tab {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    
    .modal-left {
        padding: 40px 30px;
    }
    
    .modal-right {
        min-height: 400px;
    }
    
    .modal-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .stat-item:last-child {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .services-page-section {
        padding: 120px 4% 60px;
    }
    
    .services-page-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .search-bar-wrapper {
        margin-bottom: 25px;
    }
    
    .service-search-input {
        padding: 14px 50px 14px 50px;
        font-size: 15px;
    }
    
    .category-filter-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-tab {
        justify-content: center;
    }
    
    .additional-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-checkbox,
    .reset-filters-btn {
        justify-content: center;
    }
    
    .pagination-container {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .pagination-numbers {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .pagination-btn {
        flex: 1;
        justify-content: center;
    }
    
    .modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .modal-left {
        padding: 30px 20px;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .services-page-section {
        padding: 100px 3% 40px;
    }
    
    .services-page-header h1 {
        font-size: 2rem;
    }
    
    .service-card {
        padding: 25px 20px;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
    }
    
    .service-icon img {
        width: 40px;
        height: 40px;
    }
    
    .service-title {
        font-size: 1.3rem;
    }
    
    .offer-badge,
    .featured-badge {
        top: 10px;
        padding: 5px 12px;
        font-size: 11px;
    }
    
    .pagination-number {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
}