﻿/* BrandKit Preference Tab Styles */

.brandkit-preference {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: minmax(200px, auto);
    grid-auto-flow: row;
    gap: 1.5rem;
    padding: 1.5rem;
    width: 100%;
}

.section-mini-container {
    min-width: 260px;
    width: 100%;
    grid-row: auto;
}

@media (min-width: 1400px) {
    .brandkit-preference {
        grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(260px, 1fr);
    }

    .section-mini-container:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .section-mini-container:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .section-mini-container:nth-child(3) {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .section-mini-container:nth-child(4) {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
}

.brandkit-preference-header {
    width: 100%;
    background: #fff;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    padding-top: 1.5rem;
}

.brandkit-preference-logo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.brandkit-preference-logo:hover .logo-upload-overlay {
    opacity: 1;
}

.brandkit-preference-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.logo-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 8px;
}

.logo-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.logo-upload-text {
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
    text-align: center;
    padding: 0.25rem;
}

.reference-image-container,
.reference-video-container {
    width: 100%;
    min-height: 200px;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.reference-image-container:hover .logo-upload-overlay,
.reference-video-container:hover .logo-upload-overlay {
    opacity: 1;
}

.reference-image-container img {
    width: 100%;
    height: auto;
    min-height: 200px;
    max-height: 300px;
    object-fit: contain;
    padding: 0.5rem;
    display: block;
}

.reference-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    max-height: 300px;
}

.brandkit-preference-header-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.brandkit-preference-header .preference-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}


.brandkit-preference-header .text-muted {
    color: #6b7280;
    margin: 0;
}

.brandkit-preference-body {
    padding: 1.5rem;
}

.panel {
    min-height: 200px;
}

.subhead {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.chip:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.chip input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.chip input[type="radio"]:checked + span {
    font-weight: 600;
    color: #623CEA;
}

.chip:has(input[type="radio"]:checked) {
    background: #EFECFF;
    border-color: #623CEA;
    color: #623CEA;
}

.form-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-row {
    display: flex;
    flex-direction: column;
}

.form-row label {
    margin-bottom: 0.5rem;
}

.uploader {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 3px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.2s;
    cursor: pointer;
}

.uploader:hover {
    border-color: #623CEA;
    background: #EFECFF;
}

.file-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.uploader span {
    display: block;
    color: #6b7280;
    font-size: 0.875rem;
}

.uploader span em {
    color: #9ca3af;
    font-size: 0.75rem;
}

.uploaded-files {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #623CEA;
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.thumb-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.pill-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pill {
    padding: 0.25rem 0.75rem;
    background: #EFECFF;
    color: #623CEA;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    color: #6b7280;
    font-size: 1rem;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: #623CEA;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #623CEA;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.preference-form-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    left: 0;
    top: 0;
    width: 100%;
}

.preference-content-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
}

.preference-actions {
    width: 100%;
    padding: 20px 10px 0 0;
    display: flex;
    justify-content: flex-end;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.btn-purple {
    background: #623CEA;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-purple:hover:not(:disabled) {
    background: #4f2bb8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(98, 60, 234, 0.3);
}

.btn-purple:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading-state {
    padding: 3rem;
    text-align: center;
    color: #6b7280;
}

.no-brandkit-selected {
    padding: 3rem;
    text-align: center;
    background: #f9fafb;
    border-radius: 8px;
    color: #6b7280;
}

.save-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    padding-right: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 250px;
    max-width: 400px;
}

.save-message.success {
    background: #10b981;
    color: white;
}

.save-message.error {
    background: #ef4444;
    color: white;
}

.save-message-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-message-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1400px) {
    .brandkit-preference {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .section-mini-container:nth-child(1),
    .section-mini-container:nth-child(2),
    .section-mini-container:nth-child(3),
    .section-mini-container:nth-child(4) {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 1200px) {
    .brandkit-preference {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    .form-two {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .brandkit-preference {
        grid-template-columns: 1fr;
        padding: 1rem 0.5rem;
    }

    .section-mini-container {
        width: 100% !important;
        min-width: 100% !important;
    }

    .brandkit-preference-body {
        padding: 1rem;
    }

    .chip-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .chip {
        width: 100%;
        justify-content: flex-start;
    }

    .preference-actions {
        padding: 1rem;
    }

    .btn-purple {
        width: 100%;
    }

    .save-message {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: calc(100% - 20px);
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .brandkit-preference-header {
        padding: 1rem;
        gap: 1rem;
    }

    .brandkit-preference-logo {
        width: 50px;
        height: 50px;
    }

    .brandkit-preference-header h2 {
        font-size: 1.25rem;
    }

    .thumb-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Lazy loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lazy-load-avatar {
    position: relative;
    min-height: 60px;
}

.loading-spinner {
    opacity: 0.6;
}

/* Font Family Dropdown Styles */
.font-family-select {
    transition: font-family 0.2s ease;
}

/* Style options in the dropdown (limited browser support) */
.font-family-select option[value="Serif"] {
    font-family: "Times New Roman", "Georgia", "Palatino", serif;
}

.font-family-select option[value="Sans Serif"] {
    font-family: Arial, Helvetica, Verdana, sans-serif;
}

.font-family-select option[value="Hand Writing"] {
    font-family: "Comic Sans MS", "Brush Script MT", "Lucida Handwriting", cursive;
}

.font-family-select option[value="Pixel"] {
    font-family: "Courier New", Monaco, Consolas, monospace;
    letter-spacing: 0.05em;
}

.font-family-select option[value="Display"] {
    font-family: Impact, "Arial Black", "Franklin Gothic Heavy", sans-serif;
    font-weight: bold;
    letter-spacing: 0.05em;
}

/* Back button styles */
.btn-back:hover {
    background: #e5e7eb !important;
    border-color: #9ca3af !important;
    color: #1f2937 !important;
}

.btn-back:active {
    background: #d1d5db !important;
}

