* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #F4F4F4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.template-selection-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.template-header-nav {
    background-color: #F4F4F4;
    padding: 20px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #4B1A6C;
}

.logo img {
    height: 32px;
}

.login-btn {
    padding: 8px 24px;
    border: 1px solid #5F28BC;
    border-radius: 8px;
    color: #5F28BC;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.login-btn:hover {
    background-color: #5F28BC;
    color: white;
}

/* Main Content */
.template-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background-color: #F4F4F4;
}

.template-main-container {
    max-width: 1200px;
    width: 100%;
}

.main-title {
    font-size: 36px;
    font-weight: 600;
    color: #27272E;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.main-subtitle {
    font-size: 16px;
    color: #242A41;
    text-align: center;
    margin-bottom: 48px;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.template-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 0;
    transition: all 0.2s;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.template-card:hover {
    border-color: #d4d4d4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.template-card.start-from-scratch {
    background: #F1ECF8;
    border: 1px solid #BAA4E0;
    color: #1a1a1a;
    padding: 0;
}

.template-preview {
    width: 100%;
    height: 180px;
    margin-bottom: 0;
    overflow: hidden;
    background: #f3f4f6;
    border-radius: 12px 12px 0 0;
}

.start-from-scratch .template-preview {
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
}

.template-mockup {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    padding: 16px;
    width: 100%;
    max-width: 200px;
}

.mockup-header {
    background: #7c3aed;
    color: white;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 10px;
    font-weight: 500;
}

.mockup-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mockup-input {
    height: 8px;
    background: #e5e5e5;
    border-radius: 2px;
}

.mockup-input.short {
    width: 60%;
}

.template-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.start-from-scratch .template-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.template-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.start-from-scratch .template-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.template-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 0;
    color: #1a1a1a;
}

.start-from-scratch .template-title {
    color: #1a1a1a;
}

.template-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 16px;
    flex: 1;
}

.start-from-scratch .template-description {
    color: #666;
}

/* Buttons */
.start-btn {
    width: 100%;
    padding: 10px 20px;
    background: #4B1A6C;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.start-btn:hover {
    background: #3a1452;
}

.use-template-btn {
    width: 100%;
    padding: 10px 20px;
    background: white;
    color: #333;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.use-template-btn:hover {
    background: #f9fafb;
    border-color: #d4d4d4;
}

/* Icon handled by img tag now */

/* Browse More */
.browse-more {
    text-align: center;
    margin-bottom: 48px;
}

.browse-link {
    color: #4B1A6C;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.browse-link:hover {
    opacity: 0.8;
}

.arrow-icon {
    display: inline-block;
    transition: transform 0.2s;
}

.browse-link:hover .arrow-icon {
    transform: translateX(4px);
}

/* Demo Section */
.demo-section {
    text-align: center;
    margin-top: 60px;
}

.demo-btn {
    background: transparent;
    border: none;
    color: #1E293B;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.demo-btn:hover {
    background: #f9fafb;
    color: #1E293B;
    opacity: 0.8;
}

.play-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 10px;
}

/* Footer */
.template-footer {
    background: white;
    padding: 24px;
    text-align: center;
}

.template-footer p {
    color: #999;
    font-size: 14px;
    text-align: center;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .templates-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        padding: 0 20px;
    }
}

@media (max-width: 992px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 28px;
    }

    .main-subtitle {
        font-size: 14px;
    }

    .templates-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .template-content {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 24px;
    }

    .header-container {
        padding: 0 16px;
    }

    .login-btn {
        padding: 6px 16px;
        font-size: 13px;
    }

    .template-card {
        padding: 12px;
    }

    .template-preview {
        height: 140px;
    }
}