/**
 * Therapy Services Grid - Professional Grey Theme
 * Centrum Terapii Design System
 */

/* CSS Variables - Professional Grey Palette */
:root {
    --therapy-dark: #212529;
    --therapy-grey-dark: #4A4A4A;
    --therapy-grey-medium: #6C757D;
    --therapy-grey-light: #ADB5BD;
    --therapy-grey-lighter: #DEE2E6;
    --therapy-grey-lightest: #F8F9FA;
    --therapy-white: #FFFFFF;

    /* Gradients */
    --therapy-gradient: linear-gradient(135deg, #4A4A4A 0%, #6C757D 100%);
    --therapy-gradient-hover: linear-gradient(135deg, #6C757D 0%, #868E96 100%);

    /* Shadows */
    --therapy-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --therapy-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --therapy-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --therapy-shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.18);
}

/* Main Container */
.therapy-services-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 40px auto;
    width: 100%;
    max-width: 1200px;
    padding: 0 15px;
}

/* Grid Layout */
.therapy-services-grid {
    display: grid;
    gap: 25px;
    padding: 30px 0;
    transition: opacity 0.3s ease;
}

.therapy-services-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Grid Columns */
.therapy-services-grid.columns-1 {
    grid-template-columns: 1fr;
}

.therapy-services-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.therapy-services-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.therapy-services-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Service Item */
.therapy-service-item {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Service Box */
.therapy-service-box {
    position: relative;
    height: 320px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--therapy-shadow-md);
    background: var(--therapy-gradient);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.therapy-service-box:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--background-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.therapy-service-box:hover {
    box-shadow: var(--therapy-shadow-xl);
}

.therapy-service-box:hover:before {
    transform: scale(1.08);
    opacity: 0.4;
}

/* Overlay */
.therapy-service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
            rgba(33, 37, 41, 0) 0%,
            rgba(33, 37, 41, 0.3) 80%,
            rgba(33, 37, 41, 0.8) 100%);
    z-index: 2;
    transition: all 0.4s ease;
}

.therapy-service-box:hover .therapy-service-overlay {
    background: linear-gradient(180deg,
            rgba(76, 76, 76, 0.7) 0%,
            rgba(76, 76, 76, 0.85) 50%,
            rgba(33, 37, 41, 0.95) 100%);
}

/* Content */
.therapy-service-content {
    position: absolute;
    z-index: 3;
    bottom: 25px;
    left: 25px;
    right: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.therapy-service-name {
    color: var(--therapy-white);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hover Content */
.therapy-service-hover-content {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.therapy-service-box:hover .therapy-service-hover-content {
    opacity: 1;
    transform: translateY(0);
}

.therapy-service-box:hover .therapy-service-content {
    opacity: 0;
    transform: translateY(10px);
}

.therapy-service-preview {
    color: var(--therapy-white);
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 24px 0;
    font-weight: 400;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Read More Button */
.therapy-service-read-more {
    display: inline-block;
    padding: 10px 28px;
    background: var(--therapy-white);
    color: var(--therapy-grey-dark);
    font-weight: 600;
    font-size: 14px;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.therapy-service-read-more:hover {
    background: var(--therapy-gradient);
    color: var(--therapy-white);
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Link Styling */
.therapy-service-box a {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    text-decoration: none;
    cursor: pointer;
}

/* Hidden Full Content */
.therapy-service-full-content {
    display: none;
}

/* Load More Button */
.therapy-services-load-more-container {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
}

.therapy-services-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 40px;
    background: var(--therapy-gradient);
    color: var(--therapy-white);
    border: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: var(--therapy-shadow-md);
    letter-spacing: 0.5px;
}

.therapy-services-load-more-btn:hover {
    background: var(--therapy-gradient-hover);
    transform: translateY(-2px);
    box-shadow: var(--therapy-shadow-lg);
}

.therapy-services-load-more-btn:disabled,
.therapy-services-load-more-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.therapy-services-load-more-btn.loading:after {
    content: '...';
    display: inline-block;
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0% {
        content: '.';
    }

    33% {
        content: '..';
    }

    66% {
        content: '...';
    }
}

/* Modal Styles */
.therapy-service-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(33, 37, 41, 0.15);
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease;
    /* Flexbox for vertical centering */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.therapy-service-modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.therapy-service-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: var(--therapy-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--therapy-grey-dark);
    font-size: 24px;
    font-weight: 300;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--therapy-shadow-lg);
}

.therapy-service-modal-close:hover {
    background: var(--therapy-gradient);
    color: var(--therapy-white);
    transform: rotate(90deg);
}

.therapy-service-modal-container {
    background: var(--therapy-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.therapy-service-modal-header {
    background: var(--therapy-gradient);
    padding: 30px;
    color: var(--therapy-white);
    flex-shrink: 0;
}

.therapy-service-modal-title {
    font-size: 28px;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.therapy-service-modal-body {
    padding: 35px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.7;
    color: var(--therapy-grey-dark);
    font-size: 15px;
}

.therapy-service-modal-body::-webkit-scrollbar {
    width: 8px;
}

.therapy-service-modal-body::-webkit-scrollbar-track {
    background: var(--therapy-grey-lightest);
    border-radius: 4px;
}

.therapy-service-modal-body::-webkit-scrollbar-thumb {
    background: var(--therapy-grey-light);
    border-radius: 4px;
}

.therapy-service-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--therapy-grey-medium);
}

.therapy-service-modal-body h1,
.therapy-service-modal-body h2,
.therapy-service-modal-body h3,
.therapy-service-modal-body h4 {
    color: var(--therapy-dark);
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
}

.therapy-service-modal-body p {
    margin-bottom: 16px;
}

.therapy-service-modal-body ul,
.therapy-service-modal-body ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

.therapy-service-modal-body li {
    margin-bottom: 8px;
}

.therapy-service-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Body Modal Open State */
body.modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .therapy-services-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    .therapy-services-grid.columns-3,
    .therapy-services-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .therapy-service-box {
        height: 280px;
    }

    .therapy-service-modal-content {
        width: 95%;
        margin: 20px auto;
    }

    .therapy-service-modal-close {
        top: 10px;
        right: 10px;
    }

    .therapy-service-modal-header {
        padding: 25px;
    }

    .therapy-service-modal-title {
        font-size: 24px;
    }

    .therapy-service-modal-body {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .therapy-services-container {
        margin: 20px auto;
    }

    .therapy-services-grid.columns-2,
    .therapy-services-grid.columns-3,
    .therapy-services-grid.columns-4 {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .therapy-service-box {
        height: 250px;
    }

    .therapy-service-content {
        bottom: 20px;
        left: 20px;
        right: 20px;
    }

    .therapy-service-name {
        font-size: 18px;
    }

    .therapy-service-hover-content {
        padding: 20px;
    }

    .therapy-service-preview {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .therapy-service-modal-header {
        padding: 20px;
    }

    .therapy-service-modal-title {
        font-size: 20px;
    }

    .therapy-service-modal-body {
        padding: 20px;
        font-size: 14px;
    }

    .therapy-services-load-more-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
}

/* Print Styles */
@media print {

    .therapy-services-load-more-container,
    .therapy-service-modal {
        display: none !important;
    }

    .therapy-services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .therapy-service-box {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}