/* ===== MAIN CONTAINER ===== */
.bcg-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Montserrat', sans-serif;
}

.bcg-title {
    text-align: center;
    color: white;
    font-size: 3rem;
    margin-bottom: 40px;
    font-family: 'Playfair Display', serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* ===== UPGRADE BANNER ===== */
#bcg-upgrade-banner {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 4px 20px rgba(245, 87, 108, 0.3);
}

#bcg-upgrade-banner .banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

#bcg-upgrade-banner .banner-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

#bcg-upgrade-banner .banner-icon {
    font-size: 2.5rem;
}

#bcg-upgrade-banner .banner-title {
    font-size: 1.2rem;
    font-weight: 700;
}

#bcg-upgrade-banner .banner-subtitle {
    font-size: 0.95rem;
    opacity: 0.95;
    margin-top: 5px;
}

#bcg-upgrade-banner .banner-btn {
    background: white;
    color: #f5576c;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#bcg-upgrade-banner .banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

/* ===== STATUS BAR ===== */
.bcg-status-bar {
    background: white;
    border-radius: 12px;
    padding: 12px 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 5px solid #667eea;
}

.bcg-status-bar.premium {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.bcg-status-bar.limit-reached {
    border-left-color: #e53e3e;
    background: #fff5f5;
}

.bcg-status-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: #2d3748;
}

#bcg-status-icon {
    font-size: 1.5rem;
}

.bcg-status-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bcg-status-upgrade {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.bcg-status-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(237, 137, 54, 0.4);
    color: white;
}

.bcg-status-premium-badge {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* ===== GRID ===== */
.bcg-grid {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ===== CONTROLS ===== */
.bcg-controls {
    background: #f7fafc;
    padding: 30px;
    border-radius: 15px;
    max-height: 90vh;
    overflow-y: auto;
}

.bcg-controls::-webkit-scrollbar {
    width: 8px;
}
.bcg-controls::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}
.bcg-controls::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

/* ===== SECTION HEADERS ===== */
.bcg-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin: 30px 0 20px 0;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.bcg-section-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.bcg-section-icon {
    font-size: 1.4rem;
}

.bcg-section-label {
    flex: 1;
}

.bcg-section-hint {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.85;
    font-style: italic;
}

.bcg-section-basic {
    background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
    color: white;
    border-left: 5px solid #2b6cb0;
}
.bcg-section-style {
    background: linear-gradient(135deg, #9f7aea 0%, #b794f6 100%);
    color: white;
    border-left: 5px solid #805ad5;
}
.bcg-section-typography {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: white;
    border-left: 5px solid #dd6b20;
}
.bcg-section-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-left: 5px solid #4c51bf;
}
.bcg-section-subheading {
    background: linear-gradient(135deg, #4fd3c5 0%, #38b2ac 100%);
    color: white;
    border-left: 5px solid #2c7a7b;
}
.bcg-section-author {
    background: linear-gradient(135deg, #f687b3 0%, #ed64a6 100%);
    color: white;
    border-left: 5px solid #d53f8c;
}
.bcg-section-badge {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: white;
    border-left: 5px solid #dd6b20;
}

/* ===== FORM GROUPS ===== */
.bcg-form-group {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
}

.bcg-form-group:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.bcg-form-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bcg-form-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.bcg-form-group input[type="text"],
.bcg-form-group input[type="number"],
.bcg-form-group select {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s;
}

.bcg-form-group input[type="text"]:focus,
.bcg-form-group input[type="number"]:focus,
.bcg-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bcg-form-group select {
    width: 100%;
    padding: 14px 45px 14px 16px !important;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: #2d3748;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 50px;
    transition: all 0.3s;
    display: block;
}

.bcg-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bcg-form-group select option {
    padding: 12px 16px;
    font-size: 1rem;
    color: #2d3748;
    background: white;
}

/* ===== BADGES ===== */
.bcg-badge-required {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fed7d7;
    color: #c53030;
    margin-left: 8px;
}

.bcg-badge-optional {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e2e8f0;
    color: #4a5568;
    margin-left: 8px;
}

/* ===== COLOR PICKER ===== */
.bcg-color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bcg-color-picker-wrapper input[type="color"] {
    width: 60px;
    height: 45px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
}

.bcg-color-value {
    font-family: monospace;
    font-weight: 600;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: #f7fafc;
}

/* ===== RANGE SLIDERS ===== */
.bcg-form-group input[type="range"] {
    width: 100%;
    margin-top: 10px;
    -webkit-appearance: none;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
}

.bcg-form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* ===== STYLE GRID ===== */
.bcg-style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bcg-style-option {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    background: white;
    transition: all 0.3s;
}

.bcg-style-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.bcg-style-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* ===== BUTTONS ===== */
.bcg-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}

.bcg-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bcg-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.bcg-btn-secondary {
    background: #48bb78;
    color: white;
}

.bcg-btn-secondary:hover {
    background: #38a169;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(72, 187, 120, 0.4);
}

/* ===== ERROR ===== */
.bcg-error {
    background: #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
    border-left: 4px solid #c53030;
}

.bcg-error.active {
    display: block;
    animation: shake 0.5s;
}

.bcg-error a {
    color: #667eea;
    font-weight: 700;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* ===== PREVIEW ===== */
.bcg-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bcg-canvas-scroll {
    width: 100%;
    max-height: 640px;
    overflow: auto;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.bcg-canvas-wrapper {
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

#bcg-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.bcg-zoom-control {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 420px;
    margin: 14px auto 0;
    padding: 8px 14px;
    background: #f4f5f8;
    border-radius: 30px;
}

.bcg-zoom-control .bcg-zoom-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.bcg-zoom-control input[type="range"] {
    flex: 1;
}

.bcg-zoom-control #bcg-zoom-value {
    font-size: 13px;
    font-weight: 600;
    min-width: 42px;
    text-align: right;
    flex-shrink: 0;
}

.bcg-zoom-control #bcg-zoom-reset {
    flex-shrink: 0;
    border: none;
    background: #e2e4ea;
    color: #333;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
}

.bcg-zoom-control #bcg-zoom-reset:hover {
    background: #d3d6de;
}

.bcg-zoom-hint {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin: 6px 0 0;
}

.bcg-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px 60px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.bcg-loading.active {
    display: block;
}

.bcg-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== IMAGE SELECTOR ===== */
.bcg-image-selector {
    margin-top: 30px;
    width: 100%;
    background: white;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.bcg-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-height: 650px;
    overflow-y: scroll !important;
    overflow-x: hidden;
    padding: 10px;
    box-sizing: border-box;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.bcg-thumbnails::-webkit-scrollbar {
    width: 14px !important;
    display: block !important;
}

.bcg-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 7px;
}

.bcg-thumbnails::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 7px;
    border: 2px solid #f1f1f1;
    min-height: 100px;
}

.bcg-thumbnail {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.2s;
    aspect-ratio: 2/3;
    background: #e2e8f0;
}

.bcg-thumbnail:hover {
    transform: scale(1.03);
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.bcg-thumbnail.active {
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.3);
}

.bcg-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .bcg-grid {
        grid-template-columns: 1fr;
    }
    .bcg-title {
        font-size: 2rem;
    }
    .bcg-thumbnails {
        grid-template-columns: repeat(4, 1fr);
        max-height: 500px;
    }
    .bcg-status-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    #bcg-upgrade-banner .banner-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .bcg-section-header {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 14px;
    }
    .bcg-section-hint {
        font-size: 0.8rem;
    }
    .bcg-thumbnails {
        grid-template-columns: repeat(3, 1fr);
        max-height: 400px;
    }
    .bcg-style-grid {
        grid-template-columns: 1fr;
    }
    .bcg-status-actions {
        flex-direction: column;
        width: 100%;
    }
    .bcg-status-upgrade {
        width: 100%;
        text-align: center;
    }
    #bcg-upgrade-banner .banner-left {
        flex-direction: column;
        text-align: center;
    }
    #bcg-upgrade-banner .banner-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .bcg-thumbnails {
        grid-template-columns: repeat(2, 1fr);
    }
}