/* ========================
   Jackbox Template Launcher - Styles
   ======================== */

:root {
    --primary-color: #1B5E20;
    --secondary-color: #2E7D32;
    --accent-color: #43A047;
    --dark-bg: #FFFFFF;
    --card-bg: #F5F5F5;
    --text-light: #212121;
    --text-dark: #212121;
    --success: #4CAF50;
    --error: #D32F2F;
    --warning: #F57C00;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #FFFFFF;
    color: var(--text-light);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
}

.header-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.logo {
    display: none;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-light);
    opacity: 0.8;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.error {
    background: rgba(244, 67, 54, 0.1);
    border: 2px solid var(--error);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin: 40px auto;
    max-width: 500px;
}

.error button {
    margin-top: 15px;
    padding: 10px 30px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.error button:hover {
    opacity: 0.9;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px;
    align-items: stretch;
}

.template-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.template-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-light);
}

.template-category {
    background: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.template-description {
    color: var(--text-light);
    opacity: 0.8;
    margin-bottom: 20px;
    line-height: 1.6;
    flex-grow: 1;
}

.template-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.template-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.launch-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.launch-btn:hover {
    opacity: 0.9;
}

.launch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.edit-btn-container {
    position: relative;
    display: inline-block;
}

.edit-btn {
    width: 100%;
    padding: 12px;
    background: #E0E0E0;
    color: #9E9E9E;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: not-allowed;
}

.coming-soon-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #FFFFFF;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
}

/* Deployment Status */
.deployment-status {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.status-step {
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.status-step.active {
    opacity: 1;
}

.status-step.complete {
    opacity: 1;
}

.step-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.step-text {
    font-size: 1.1rem;
}

.status-step.active .step-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Progress Bar */
.progress-container {
    margin: 30px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 15px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 10px;
    color: var(--primary-color);
}

.deployment-message {
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
    margin: 20px 0;
}

/* Deployment Ready */
.deployment-ready {
    text-align: center;
}

.deployment-ready h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.url-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.url-container input {
    flex: 1;
    padding: 12px;
    background: #F5F5F5;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
}

.url-container button {
    padding: 12px 24px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.url-container button:hover {
    opacity: 0.9;
}

.primary-btn {
    padding: 15px 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.primary-btn:hover {
    opacity: 0.9;
}

/* Deployment Error */
.deployment-error {
    text-align: center;
    color: var(--error);
}

.deployment-error p {
    margin: 10px 0;
}

.deployment-error button {
    margin-top: 20px;
    padding: 12px 30px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .logo {
        font-size: 2.5rem;
    }

    .template-title {
        font-size: 1.5rem;
    }

    .modal-content {
        margin: 20px;
    }
}
