/* 
   CyberPools Templates Page - CSS
   This file contains styles specific to the templates page,
   complementing the main cyberpools-fixed-css.css file
*/

/* ======= TEMPLATE PAGE SPECIFIC STYLES ======= */

/* Templates section styling */
.templates {
    padding: 3rem 0 5rem;
    background-color: var(--background);
    transition: background-color 0.3s ease;
}

/* Template selection */
.template-selection {
    max-width: 800px;
    margin: 2rem auto 4rem; /* Increased bottom margin */
    text-align: center; /* Center the contents */
}

/* Content spacer to push footer down */
.content-spacer {
    min-height: 2rem;
    flex-grow: 1;
}

.template-select-container {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the elements */
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    margin-bottom: 2rem;
    gap: 1.5rem; /* Add space between elements */
}

.template-select {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--input-bg);
    color: var(--input-text);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    cursor: pointer;
}

.template-select:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline);
    outline-offset: 2px;
}

/* View toggle buttons */
.view-options {
    display: flex;
    margin-left: 1rem;
}

.view-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover, .view-btn:focus {
    color: var(--primary);
    background-color: var(--hover-bg);
}

.view-btn:focus {
    outline: var(--focus-outline-width) solid var(--focus-outline);
    outline-offset: 2px;
}

.view-btn.active {
    color: var(--primary);
    background-color: var(--hover-bg);
}

.view-btn + .view-btn {
    margin-left: 0.5rem;
}

/* Template display */
.template-display {
    max-width: 1000px;
    margin: 0 auto 3rem;
}

.template-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-color);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.template-card h2 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.template-card p {
    color: var(--secondary);
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Template image */
.template-image-wrapper {
    position: relative;
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.template-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #eaeaea;
    border-radius: 4px;
}

/* Desktop vs Mobile view */
.desktop-view .template-image-wrapper {
    max-width: 800px;
}

.mobile-view .template-image-wrapper {
    max-width: 375px;
    padding: 0.5rem 0.5rem 2rem;
    border-radius: 20px;
}

.mobile-view .template-image {
    border-radius: 12px;
}

/* Template info section */
.template-info {
    max-width: 800px;
    margin: 5rem auto 4rem; /* Increased margins top and bottom */
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.template-info h2 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.template-info p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    text-align: center; /* Center paragraph text */
}

.template-info p:last-child {
    margin-bottom: 0;
}

.template-info a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.template-info a:hover {
    text-decoration: underline;
}

/* ======= RESPONSIVE STYLES ======= */

/* Large screens (992px and below) */
@media (max-width: 992px) {
    .template-image-wrapper {
        max-width: 720px;
    }
}

/* Medium screens (768px and below) */
@media (max-width: 768px) {
    .template-select-container {
        flex-direction: column;
        align-items: center;
    }
    
    .view-options {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .template-card {
        padding: 1.5rem;
    }
    
    .template-card h2 {
        font-size: 1.5rem;
    }
    
    .desktop-view .template-image-wrapper {
        max-width: 100%;
    }
    
    /* Ensure minimum page height on mobile */
    main {
        min-height: 70vh;
    }
}

/* Small screens (576px and below) */
@media (max-width: 576px) {
    .template-card {
        padding: 1rem;
    }
    
    .template-selection {
        margin: 1rem auto;
    }
    
    .template-info {
        padding: 1.5rem;
    }
}
