/* Figmaas Design Tokens */
:root {
    --primary-brand: #c253f9;
    --primary-hover: #a73ee0;
    --neutral-dark: #1A1A1A;
    --neutral-mid: #6B7280;
    --neutral-light: #9CA3AF;
    --border-light: #E5E7EB;
    --bg-subtle: #F9FAFB;
    --success: #10B981;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* Two Column Layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

/* LEFT COLUMN - Preview Card */
.preview-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: sticky;
    top: 24px;
}

.preview-area {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='10' height='10' fill='%23f3f4f6'/%3E%3Crect x='10' y='10' width='10' height='10' fill='%23f3f4f6'/%3E%3C/svg%3E");
    padding: 40px;
    transition: background 0.3s ease;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.icon-display {
    width: 128px;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.08));
}

.icon-display svg {
    width: 100%;
    height: 100%;
}

/* Preview Controls Bar */
.preview-controls-bar {
    padding: 20px 24px;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--neutral-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.value-display {
    color: var(--primary-brand);
    font-weight: 700;
}

/* Background Toggle Buttons */
.bg-toggle-buttons {
    display: flex;
    gap: 8px;
}

.bg-btn {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.bg-btn:hover {
    border-color: var(--border-light);
    transform: scale(1.05);
}

.bg-btn.active {
    border-color: var(--primary-brand);
    box-shadow: 0 0 0 3px rgba(194, 83, 249, 0.1);
}

/* Size Slider */
.figmaas-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-light);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.figmaas-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-brand);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(194, 83, 249, 0.4);
    transition: transform 0.2s ease;
}

.figmaas-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.figmaas-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-brand);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(194, 83, 249, 0.4);
}

/* Size Options Group */
.size-options-group {
    display: flex;
    gap: 8px;
}

.size-option-btn {
    flex: 1;
    padding: 5px 8px;
    background: #ffffff;
    border: 1.5px solid var(--border-light);
    border-radius: 9999px;
    color: var(--neutral-mid);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.size-option-btn:hover {
    border-color: var(--primary-brand);
    color: var(--primary-brand);
}

.size-option-btn.active {
    background: rgba(194, 83, 249, 0.1);
    border-color: var(--primary-brand);
    color: var(--primary-brand);
}

/* Stroke Presets */
.stroke-presets {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.preset-btn {
    flex: 1;
    padding: 4px 6px;
    background: #ffffff;
    border: 1.5px solid var(--border-light);
    border-radius: 9999px;
    color: var(--neutral-mid);
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.preset-btn:hover {
    border-color: var(--primary-brand);
    color: var(--primary-brand);
}

.preset-btn.active {
    background: rgba(194, 83, 249, 0.1);
    border-color: var(--primary-brand);
    color: var(--primary-brand);
}

/* Color Presets - Display in one line */
.color-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.color-input {
    width: 44px;
    height: 32px;
    border: 3px solid transparent;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #ff0000 0%, #ff7f00 12.5%, #ffff00 25%, #00ff00 37.5%,
            #0000ff 50%, #4b0082 62.5%, #9400d3 75%, #ff0000 100%) border-box;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: rainbow-pulse 3s ease-in-out infinite;
}

@keyframes rainbow-pulse {
    0%,
    100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.color-input:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(194, 83, 249, 0.4), 0 0 0 4px rgba(194, 83, 249, 0.1);
    border-width: 3px;
}

.color-preset-btn {
    width: 28px;
    height: 28px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.color-preset-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.color-preset-btn.active {
    border-color: var(--primary-brand);
    box-shadow: 0 0 0 3px rgba(194, 83, 249, 0.15);
}

/* Reset Button */
.reset-btn {
    width: 100%;
    padding: 8px 12px;
    background: #ffffff;
    border: 1.5px solid var(--border-light);
    border-radius: 9999px;
    color: var(--neutral-mid);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 2px;
}

.reset-btn:hover {
    border-color: var(--primary-brand);
    color: var(--primary-brand);
    background: rgba(194, 83, 249, 0.04);
}

.reset-btn svg {
    flex-shrink: 0;
}

/* RIGHT COLUMN */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Icon Header */
.icon-header {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.icon-title {
    font-size: 30px !important;
    font-weight: 600;
    color: var(--neutral-dark);
    margin: 0 0 10px;
    line-height: 1.2;
}

.icon-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(194, 83, 249, 0.08);
    border: 1px solid rgba(194, 83, 249, 0.2);
    border-radius: 9999px;
    color: var(--primary-brand);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-badge:hover {
    background: rgba(194, 83, 249, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(194, 83, 249, 0.2);
}

.style-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 9999px;
    color: #6B7280;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.style-badge:hover {
    background: #E5E7EB;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

/* Action Buttons */
.action-buttons-group {
    display: flex;
    gap: 12px;
}

.figmaas-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-brand), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(194, 83, 249, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(194, 83, 249, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #ffffff;
    color: var(--neutral-dark);
    border: 1.5px solid var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--primary-brand);
    color: var(--primary-brand);
    background: rgba(194, 83, 249, 0.04);
}

/* Code Block */
.code-block-container {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-light);
}

.code-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--neutral-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-code-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 9999px;
    color: var(--neutral-mid);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    border-color: var(--primary-brand);
    color: var(--primary-brand);
    background: rgba(194, 83, 249, 0.04);
}

.code-content {
    padding: 12px;
    background: #FFFFFF;
    max-height: 240px;
    overflow-y: auto;
}

.code-content pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
}

.code-content code {
    color: #1F2937;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Stats Container */
.stats-container {
    display: flex;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
}

.stat-box {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--neutral-mid);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.stat-box svg {
    flex-shrink: 0;
    color: var(--neutral-light);
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    display: inline-flex;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 9999px;
    color: var(--neutral-mid);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag-link:hover {
    background: rgba(194, 83, 249, 0.08);
    border-color: var(--primary-brand);
    color: var(--primary-brand);
    transform: translateY(-2px);
}

/* Related Icons Header */
.related-icons-header {
    margin-bottom: 32px;
    text-align: left;
}

.section-title {
    font-size: 30px !important;
    font-weight: 600;
    color: var(--neutral-dark);
    margin: 0 0 10px;
    line-height: 1.2;
}

.section-heading {
    font-size: 18px;
    font-weight: 600;
    color: var(--neutral-dark);
    margin: 0 0 8px;
    line-height: 1.4;
}

.section-subtitle {
    font-size: 15px;
    color: var(--neutral-mid);
    margin: 0;
    line-height: 1.6;
}

/* Modern Breadcrumb */
.breadcrumb-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb-modern li {
    display: flex;
    align-items: center;
}

.breadcrumb-link {
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: #c253f9;
}

.breadcrumb-active {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 24px;
    margin-top: 24px;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    animation: rotate 1s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--neutral-mid);
    margin: 0;
}

/* Figmaas Icon Grid Component */
.figmaas-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.icon-grid-item {
    position: relative;
}

.figmaas-icon-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-clickable-area {
    position: absolute;
    inset: 0;
    cursor: pointer;
    z-index: 0;
}

.icon-glow-effect {
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(194, 83, 249, 0.15), rgba(166, 65, 212, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.icon-display-link {
    display: block;
    text-decoration: none;
    position: relative;
    z-index: 2;
}

.icon-display {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 48px;
    margin-bottom: 20px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-svg-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-svg-wrapper svg {
    max-width: 48px;
    max-height: 48px;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

.icon-name {
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
    line-height: 1.4;
    position: relative;
    z-index: 3;
    transition: color 0.3s ease;
    word-break: break-word;
    text-decoration: none;
    display: block;
}

.icon-name:hover {
    color: #c253f9;
    text-decoration: none;
}

.icon-actions-wrapper {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.icon-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: #6B7280;
    pointer-events: auto;
    outline: none;
}

.icon-action-btn:hover {
    background: #c253f9;
    border-color: #c253f9;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(194, 83, 249, 0.3);
}

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

.figmaas-icon-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(194, 83, 249, 0.1);
    border-color: rgba(194, 83, 249, 0.2);
}

.figmaas-icon-card:hover .icon-glow-effect {
    opacity: 1;
}

.figmaas-icon-card:hover .icon-display {
    transform: scale(1.1);
}

.figmaas-icon-card:hover .icon-svg-wrapper svg {
    filter: drop-shadow(0 4px 12px rgba(194, 83, 249, 0.25));
}

.figmaas-icon-card:hover .icon-name {
    color: #6B7280;
}

.figmaas-icon-card .icon-name:hover {
    color: #c253f9 !important;
}

.figmaas-icon-card:hover .icon-actions-wrapper {
    opacity: 1;
    transform: translateY(0);
}

.figmaas-icon-card:active {
    transform: translateY(-2px) scale(0.98);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .preview-card {
        position: relative;
        top: 0;
    }
    .icon-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .preview-area {
        min-height: 400px;
        padding: 32px;
    }
    .action-buttons-group {
        flex-direction: column;
    }
    .stats-container {
        flex-direction: column;
        gap: 12px;
    }
    .icon-title {
        font-size: 24px;
    }
    .section-title {
        font-size: 28px;
    }
    .figmaas-icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
    .figmaas-icon-card {
        padding: 16px;
        border-radius: 12px;
    }
    .icon-display {
        margin-bottom: 16px;
    }
    .icon-action-btn {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .figmaas-icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Sidebar and Header Sync Styles */
.dashboard-main.active {
    margin-left: 80px !important;
}

.navbar-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-light);
    padding: 12px 32px !important;
    transition: all 0.3s ease;
}

#navSearch {
    display: none !important;
}

.sidebar.active .search-wrapper {
    display: none !important;
}

.breadcrumb-modern {
    padding: 0 0px 16px !important;
}

@media (max-width: 991px) {
    .navbar-header {
        background-color: #fff !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid var(--border-light) !important;
    }
    .dashboard-main.active {
        margin-left: 0 !important;
    }
}
