* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    padding: 2rem 0;
    position: relative;
}

.header-content {
    flex: 1;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.8;
}

.template-selector-wrapper {
    position: relative;
    z-index: 1000;
}

/* Ensure template selector is always accessible - override any template hiding */
header .template-selector-wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Even when parent header is hidden, keep template selector visible */
header[style*="display: none"] .template-selector-wrapper,
header:not(:visible) .template-selector-wrapper {
    display: block !important;
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 1001 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#template-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#template-menu:not(.hidden) {
    display: block !important;
    visibility: visible !important;
}

.template-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: inherit;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.template-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.template-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    min-width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.template-menu.hidden {
    display: none;
}

.template-menu-header {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.template-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.template-option {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: inherit;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.template-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.template-option.active {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.5);
}

.template-preview {
    width: 60px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.template-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.services-container {
    flex: 1;
}

.loading, .error {
    text-align: center;
    padding: 3rem;
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }

    .template-selector-wrapper {
        width: 100%;
    }

    .template-menu {
        right: auto;
        left: 0;
        width: 100%;
    }

    header h1 {
        font-size: 2.5rem;
    }
}

