/* Main container with confined space */
.terms-container {
    max-width: 1000px;  /* Reduced from 1400px for better readability */
    margin: 0 auto;
    padding: 2rem;
}

/* Content wrapper */
.terms-content-wrapper {
    display: grid;
    grid-template-columns: minmax(200px, 800px);
    justify-content: center;
    gap: 2rem;
    margin: 0 auto;
    padding: 1rem;
}

/* Remove nesting to fix header conflicts */
.terms-header {
    background: linear-gradient(145deg, 
        #333333 0%, 
        #3d1a1a 25%,
        #4d0000 50%,
        #590000 75%,
        #660000 100%
    );
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.terms-header h1 {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.terms-section {
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: left;
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.5s ease-out;
}

.terms-section.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scope all text styles properly */
.terms-section p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: justify;
}

.terms-section h2,
.terms-section h3,
.terms-section h4 {
    color: #4d0000;
    text-align: left;
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

/* Remove generic ul/li styles */
ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

li {
    color: inherit;
    line-height: inherit;
    margin-bottom: 0;
}

/* Contact section with proper scoping */
.terms-content-wrapper .contact-info {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.terms-content-wrapper .contact-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.terms-content-wrapper .contact-header {
    background: linear-gradient(145deg, 
        #333333 0%, 
        #3d1a1a 25%,
        #4d0000 50%,
        #590000 75%,
        #660000 100%
    );
    padding: 1.5rem;
    border-radius: 8px 8px 0 0;
    margin: -2rem -2rem 2rem -2rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.terms-content-wrapper .contact-header h3 {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    text-align: center;
    width: 100%;
}

.terms-content-wrapper .contact-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.terms-content-wrapper .contact-item {
    text-align: center;
    padding: 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.terms-content-wrapper .contact-item i {
    font-size: 1.8rem;
    color: #4d0000;
    margin-bottom: 0.5rem;
}

.terms-content-wrapper .contact-item a {
    color: #4d0000;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    display: block;
}

.terms-content-wrapper .contact-item:hover {
    background: rgba(77, 0, 0, 0.03);
}

/* Heading styles with left alignment */
h2, h3, h4 {
    color: #4d0000;
    text-align: left;
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid rgba(77, 0, 0, 0.1);
}

h3 {
    font-size: 1.4rem;
    border-bottom: 1px solid rgba(77, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .terms-container {
        padding: 1rem;
        margin: 0.5rem;
    }

    .terms-content-wrapper {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }

    .terms-section {
        padding: 1rem;
    }

    .terms-header h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .contact-links {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .contact-item {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    .contact-info p {
        text-align: center;
    }
}