/* style/terms-conditions.css */

/* Variables for consistency */
:root {
    --phjoy-primary: #F2C14E;
    --phjoy-secondary: #FFD36B;
    --phjoy-card-bg: #111111;
    --phjoy-background: #0A0A0A;
    --phjoy-text-main: #FFF6D6;
    --phjoy-border: #3A2A12;
    --phjoy-glow: #FFD36B;
    --phjoy-button-gradient: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%);
    --phjoy-text-dark: #333333; /* For contrast on light backgrounds */
    --phjoy-text-light: #ffffff; /* For contrast on dark backgrounds */
    --phjoy-gap: 20px;
    --phjoy-border-radius: 8px;
}

/* Base styles for the page content */
.page-terms-conditions {
    background-color: var(--phjoy-background); /* Dark background for the entire page content */
    color: var(--phjoy-text-main); /* Light text on dark background */
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding-bottom: 60px; /* Space above footer */
}

/* Section styling */
.page-terms-conditions__section {
    padding: 60px 0;
    border-bottom: 1px solid var(--phjoy-border);
}

.page-terms-conditions__section--dark {
    background-color: var(--phjoy-card-bg); /* Slightly different dark background */
}

.page-terms-conditions__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--phjoy-gap);
    box-sizing: border-box;
}

/* Hero Section */
.page-terms-conditions__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    min-height: 500px;
    background-color: var(--phjoy-background); /* Ensure dark background */
}

.page-terms-conditions__hero-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.page-terms-conditions__hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3; /* Subtle background image */
}

.page-terms-conditions__hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    padding: 40px var(--phjoy-gap);
    background: rgba(0, 0, 0, 0.7); /* Semi-transparent dark overlay for text readability */
    border-radius: var(--phjoy-border-radius);
    box-shadow: 0 0 20px rgba(255, 211, 107, 0.2); /* Soft glow */
}

.page-terms-conditions__main-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem); /* Using clamp for responsive H1 */
    color: var(--phjoy-primary);
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px rgba(255, 211, 107, 0.5);
}

.page-terms-conditions__intro-text {
    font-size: 1.1rem;
    color: var(--phjoy-text-main);
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* CTA Buttons in Hero */
.page-terms-conditions__cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.page-terms-conditions__btn-primary,
.page-terms-conditions__btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center; /* Ensure text wraps if needed */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words */
    box-sizing: border-box; /* Include padding in width calculation */
    max-width: 100%;
}

.page-terms-conditions__btn-primary {
    background: var(--phjoy-button-gradient);
    color: var(--phjoy-text-light); /* White text on dark/gold button */
    border: none;
}

.page-terms-conditions__btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 211, 107, 0.4);
}

.page-terms-conditions__btn-secondary {
    background: transparent;
    color: var(--phjoy-primary);
    border: 2px solid var(--phjoy-primary);
}

.page-terms-conditions__btn-secondary:hover {
    background: rgba(255, 211, 107, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 211, 107, 0.2);
}

/* Section Titles */
.page-terms-conditions__section-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: var(--phjoy-primary);
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 211, 107, 0.3);
}

/* Content Blocks */
.page-terms-conditions__content-block {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: flex-start;
}

.page-terms-conditions__content-block p {
    color: var(--phjoy-text-main);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 15px;
}

.page-terms-conditions__content-block p:last-child {
    margin-bottom: 0;
}

.page-terms-conditions__content-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--phjoy-border-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--phjoy-border);
}

/* Image alignment */
.page-terms-conditions__content-image--right {
    align-self: flex-end; /* Align to the right in column layout */
}

/* FAQ Section */
.page-terms-conditions__faq-section {
    padding-top: 60px;
    padding-bottom: 60px;
}

.page-terms-conditions__faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 900px;
    margin: 0 auto;
}

.page-terms-conditions__faq-item {
    background-color: var(--phjoy-card-bg);
    border: 1px solid var(--phjoy-border);
    border-radius: var(--phjoy-border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.page-terms-conditions__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    background-color: #1a1a1a; /* Slightly lighter dark for question header */
    color: var(--phjoy-primary);
    font-weight: bold;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

.page-terms-conditions__faq-question:hover {
    background-color: #2a2a2a;
}

.page-terms-conditions__faq-question h3 {
    margin: 0;
    color: var(--phjoy-primary);
    font-size: 1.1rem;
}

.page-terms-conditions__faq-toggle {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    color: var(--phjoy-secondary);
    transition: transform 0.3s ease;
}

.page-terms-conditions__faq-item.active .page-terms-conditions__faq-toggle {
    transform: rotate(45deg); /* Plus to X / Minus */
}

.page-terms-conditions__faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 25px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: var(--phjoy-text-main);
    background-color: var(--phjoy-card-bg);
}

.page-terms-conditions__faq-item.active .page-terms-conditions__faq-answer {
    max-height: 1000px !important; /* Sufficiently large to show content */
    padding: 20px 25px;
}

.page-terms-conditions__faq-answer p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
}

/* Responsive Design */
@media (min-width: 769px) {
    .page-terms-conditions__content-block {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
    .page-terms-conditions__content-block:nth-of-type(odd) {
        flex-direction: row;
    }
    .page-terms-conditions__content-block:nth-of-type(even) {
        flex-direction: row-reverse;
    }
    .page-terms-conditions__content-block p {
        flex: 1;
        max-width: calc(60% - var(--phjoy-gap) / 2);
    }
    .page-terms-conditions__content-image {
        flex: 0 0 auto;
        width: 35%;
        max-width: 400px;
    }
    .page-terms-conditions__content-image--right {
        align-self: flex-start; /* Reset for row layout */
    }
}


@media (max-width: 768px) {
    .page-terms-conditions__hero-content {
        padding: 30px var(--phjoy-gap);
    }

    .page-terms-conditions__main-title {
        font-size: 2.2rem;
    }

    .page-terms-conditions__intro-text {
        font-size: 1rem;
    }

    .page-terms-conditions__section {
        padding: 40px 0;
    }

    .page-terms-conditions__section-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .page-terms-conditions__cta-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .page-terms-conditions__btn-primary,
    .page-terms-conditions__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* General image responsiveness for mobile */
    .page-terms-conditions img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    /* Ensure containers are responsive */
    .page-terms-conditions__section,
    .page-terms-conditions__card,
    .page-terms-conditions__container,
    .page-terms-conditions__faq-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-terms-conditions__hero-section {
        padding-top: 10px !important; /* Ensure small top padding */
        min-height: 400px;
    }

    .page-terms-conditions__hero-content {
        max-width: 100%;
        margin: 0 15px;
    }

    .page-terms-conditions__content-block {
        flex-direction: column; /* Stack content and image */
        align-items: center;
    }
    .page-terms-conditions__content-block p {
        max-width: 100%;
        text-align: left;
    }
    .page-terms-conditions__content-image {
        width: 100%;
        max-width: 100%;
        margin-top: 20px;
        align-self: center;
    }
    .page-terms-conditions__content-image--right {
        align-self: center;
    }
    
    .page-terms-conditions__faq-question {
        font-size: 1rem;
        padding: 15px 20px;
    }
    .page-terms-conditions__faq-question h3 {
        font-size: 1rem;
    }
    .page-terms-conditions__faq-answer {
        padding: 0 20px;
    }
    .page-terms-conditions__faq-item.active .page-terms-conditions__faq-answer {
        padding: 15px 20px;
    }
}

/* Ensure headings maintain contrast */
.page-terms-conditions h1, .page-terms-conditions h2, .page-terms-conditions h3, .page-terms-conditions h4, .page-terms-conditions h5, .page-terms-conditions h6 {
    color: var(--phjoy-primary); /* Primary color for headings */
}

/* Paragraphs and list items */
.page-terms-conditions p, .page-terms-conditions li {
    color: var(--phjoy-text-main); /* Main text color */
}

/* Links within content */
.page-terms-conditions a:not([class*="btn"]) {
    color: var(--phjoy-secondary); /* Auxiliary color for links */
    text-decoration: underline;
}
.page-terms-conditions a:not([class*="btn"]):hover {
    color: var(--phjoy-primary);
}

/* General button styling for any a tag resembling a button */
.page-terms-conditions a[class*="button"],
.page-terms-conditions a[class*="btn"] {
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}