/* Blynk Studio - Redesigned to match site aesthetic */

/* Main Wrapper */
.blynks-studio-wrapper {
    min-height: 100vh;
    padding: 100px 15px 80px;
    background: var(--theme-bg-body, #1a1f2e);
    position: relative;
    overflow: visible;
}

.blynks-studio-wrapper.sidebar-open {
    margin-left: 260px;
}

/* Container */
.studio-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
.studio-header {
    text-align: center;
    margin-bottom: 32px;
}

.studio-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px 0;
}

.studio-header p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 16px 0;
}

.beta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.25);
    border-radius: 20px;
    color: #ffc107;
    font-size: 13px;
    font-weight: 600;
}

/* Main Layout - Two Column */
.studio-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}

/* Preview Card */
.preview-card {
    background: var(--theme-bg-card, #252b3d);
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.15));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
}

.preview-section {
    padding: 32px 24px;
    background: rgba(0, 0, 0, 0.1);
}

.preview-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    text-align: center;
}

.blynk-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    padding: 20px;
}

.blynk-character {
    position: relative;
    width: 220px;
    height: 220px;
    animation: float 4s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.blynk-character:hover {
    transform: scale(1.05);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Blynk Character Layers - Responsive Positioning */
.blynk-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.back-layer { z-index: 1; }
.body-layer { z-index: 5; }
.face-layer { z-index: 6; }
.face-accessory-layer { z-index: 10; }
.front-layer { z-index: 15; }

.blynk-item {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
    transform-origin: center center;
}

.body-color {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #fcfcfc;
    -webkit-mask: url(../images/Avatars/body/body1.png) center/contain no-repeat;
    mask: url(../images/Avatars/body/body1.png) center/contain no-repeat;
}

.body-outline {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    opacity: 0.8;
    user-select: none;
    pointer-events: none;
}

.blynk-eyes {
    position: absolute;
    width: 40%;
    height: 40%;
    top: 5%;
    left: 30%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.blynk-mouth {
    position: absolute;
    width: 35%;
    height: 35%;
    top: 20%;
    left: 32.5%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 16px;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-action:active {
    transform: scale(0.98);
}

.btn-randomize {
    background: var(--theme-accent, #4a9eff);
    border-color: var(--theme-accent, #4a9eff);
}

.btn-randomize:hover {
    background: var(--theme-accent-hover, #3a8eef);
    border-color: var(--theme-accent-hover, #3a8eef);
}

/* Coming Soon Notice */
.coming-soon-notice {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 193, 7, 0.08);
    border-top: 1px solid rgba(255, 193, 7, 0.2);
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.coming-soon-notice svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.coming-soon-notice strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.coming-soon-notice p {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 193, 7, 0.85);
    margin: 0;
}

/* Save Button */
.save-button-wrapper {
    padding: 20px;
}

.btn-save {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: var(--theme-accent, #4a9eff);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save:hover:not(.disabled) {
    background: var(--theme-accent-hover, #3a8eef);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.btn-save:active:not(.disabled) {
    transform: scale(0.98);
}

.btn-save.disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Customization Card */
.customization-card {
    background: var(--theme-bg-card, #252b3d);
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.15));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.customization-section {
    padding: 24px;
}

/* Tabs */
.tabs-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 28px;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
}

.tab-btn.active {
    background: var(--theme-accent-light, rgba(74, 158, 255, 0.15));
    color: var(--theme-accent, #4a9eff);
    border-color: var(--theme-accent, #4a9eff);
}

.tab-btn svg {
    width: 18px;
    height: 18px;
}

/* Tab Content */
.tab-content-container {
    min-height: 320px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: visible;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    padding: 4px;
    margin: -4px;
}

.tab-content-container::-webkit-scrollbar {
    width: 6px;
}

.tab-content-container::-webkit-scrollbar-track {
    background: transparent;
}

.tab-content-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content h3 {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 20px 0;
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 12px;
}

.color-option {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.color-option:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-option.active {
    border-color: #fff;
    box-shadow: 0 0 0 3px var(--theme-accent, #4a9eff), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.08);
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 12px;
}

.item-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-option {
    aspect-ratio: 1;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid var(--theme-border, rgba(255, 255, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.item-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.item-wrapper:hover .item-option {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.item-option.active {
    border-color: var(--theme-accent, #4a9eff);
    background: var(--theme-accent-light, rgba(74, 158, 255, 0.15));
    box-shadow: 0 0 0 2px var(--theme-accent, #4a9eff);
}

.item-option.none {
    font-size: 26px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

.item-wrapper:hover .item-option.none {
    color: rgba(255, 255, 255, 0.5);
}

.item-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    transition: color 0.2s ease;
    line-height: 1.3;
}

.item-wrapper:hover .item-label {
    color: rgba(255, 255, 255, 0.8);
}

.item-option.active ~ .item-label {
    color: var(--theme-accent, #4a9eff);
    font-weight: 600;
}

/* Size Options */
.size-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.size-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 20px;
    border: 2px solid var(--theme-border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.size-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.size-btn.active {
    border-color: var(--theme-accent, #4a9eff);
    background: var(--theme-accent-light, rgba(74, 158, 255, 0.15));
    color: var(--theme-accent, #4a9eff);
    box-shadow: 0 0 0 2px var(--theme-accent, #4a9eff);
}

.size-preview {
    border-radius: 50%;
    background: var(--theme-accent, #4a9eff);
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(74, 158, 255, 0.3);
}

.size-small { width: 42px; height: 42px; }
.size-medium { width: 62px; height: 62px; }
.size-large { width: 82px; height: 82px; }

.size-btn:hover .size-preview {
    transform: scale(1.1);
    box-shadow: 0 6px 14px rgba(74, 158, 255, 0.4);
}

.size-btn.active .size-preview {
    box-shadow: 0 8px 18px rgba(74, 158, 255, 0.5);
}

/* Responsive */
@media (max-width: 1024px) {
    .studio-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .preview-card {
        position: relative;
        top: 0;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 767px) {
    .blynks-studio-wrapper {
        padding: 80px 12px 100px;
    }
    
    .blynks-studio-wrapper.sidebar-open {
        margin-left: 0;
    }
    
    .studio-header h1 {
        font-size: 28px;
    }
    
    .studio-header p {
        font-size: 14px;
    }
    
    .beta-badge {
        font-size: 12px;
        padding: 6px 14px;
    }
    
    .preview-section {
        padding: 24px 16px;
    }
    
    .blynk-character {
        width: 180px;
        height: 180px;
    }
    
    .blynk-preview {
        min-height: 220px;
    }
    
    .action-buttons {
        padding: 0 16px 16px;
        gap: 8px;
    }
    
    .btn-action {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .coming-soon-notice {
        padding: 14px 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .save-button-wrapper {
        padding: 16px;
    }
    
    .customization-section {
        padding: 20px 16px;
    }
    
    .tabs-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-bottom: 20px;
    }
    
    .tab-btn {
        padding: 10px 8px;
        font-size: 11px;
        gap: 4px;
    }
    
    .tab-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .tab-btn span {
        font-size: 10px;
    }
    
    .tab-content-container {
        max-height: 380px;
    }
    
    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 10px;
    }
    
    .color-option {
        width: 40px;
        height: 40px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 10px;
    }
    
    .item-label {
        font-size: 10px;
    }
    
    .size-options {
        gap: 12px;
    }
    
    .size-btn {
        padding: 22px 16px;
        font-size: 13px;
    }
    
    .size-small { width: 36px; height: 36px; }
    .size-medium { width: 52px; height: 52px; }
    .size-large { width: 68px; height: 68px; }
}

@media (max-width: 480px) {
    .tabs-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .tab-btn {
        padding: 12px 10px;
    }
}
