/* Design System Management Styles */

/* CSS Custom Properties for Public Theme Text Colors */
:root {
    /* Public Theme Text Colors - Primary Hierarchy */
    --public-text-primary: #1a1a1a;       /* Main headings, primary content */
    --public-text-secondary: #333333;      /* Body text, paragraphs */
    --public-text-meta: #666666;          /* Meta information, dates, tags */
    --public-text-light: #999999;         /* Light text, captions, placeholders */
    --public-text-muted: #cccccc;         /* Disabled text, very subtle content */
    
    /* Public Theme Text Colors - Interactive */
    --public-link-primary: #1a1a1a;       /* Primary links */
    --public-link-hover: #666666;         /* Link hover state */
    --public-link-visited: #555555;       /* Visited links */
    --public-link-active: #000000;        /* Active links */
    
    /* Public Theme Text Colors - Semantic */
    --public-text-success: #059669;       /* Success messages */
    --public-text-warning: #d97706;       /* Warning messages */
    --public-text-error: #dc2626;         /* Error messages */
    --public-text-info: #0891b2;          /* Info messages */
    
    /* Public Theme Text Colors - Context Specific */
    --public-header-text: #ffffff;        /* Header navigation text */
    --public-header-text-hover: #cccccc;  /* Header navigation hover */
    --public-footer-text: #ffffff;        /* Footer text */
    --public-footer-text-muted: #cccccc;  /* Footer secondary text */
    
    /* Public Theme Background Colors */
    --public-header-bg: #000000;          /* Header background */
    --public-footer-bg: #000000;          /* Footer background */
    --public-background-light: #ffffff;   /* Main content background */
    --public-border-light: #e2e8f0;       /* Light borders */
    
    /* Public Theme Heading Colors */
    --public-heading-h1: #1a1a1a;         /* Main page titles */
    --public-heading-h2: #1a1a1a;         /* Section headings */
    --public-heading-h3: #333333;         /* Subsection headings */
    --public-heading-h4: #333333;         /* Minor headings */
    --public-heading-h5: #666666;         /* Small headings */
    --public-heading-h6: #666666;         /* Smallest headings */
}

.design-system-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--admin-primary-gradient);
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.page-header h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 300;
    margin: 0;
}

/* Modern Theme Tab Styles */
.theme-tab {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.04) 0%, rgba(51, 65, 85, 0.04) 100%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(30, 41, 59, 0.1);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
}

.admin-theme-tab {
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.06) 0%, rgba(49, 46, 129, 0.04) 100%);
    border: 1px solid rgba(76, 29, 149, 0.12);
}

.public-theme-tab {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.06) 0%, rgba(71, 85, 105, 0.04) 100%);
    border: 1px solid rgba(30, 41, 59, 0.12);
}

/* Public Theme Text Color Preview */
.public-text-preview {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.04) 0%, rgba(51, 65, 85, 0.04) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 41, 59, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}

.public-text-preview h3 {
    margin: 0 0 2rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4c1d95 0%, #312e81 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.text-hierarchy-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.text-samples {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(30, 41, 59, 0.1);
}

.text-samples h4 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.text-sample {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.text-sample-label {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(30, 41, 59, 0.08);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: inline-block;
}

/* Text Color Swatches */
.text-color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.text-color-group {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(30, 41, 59, 0.1);
}

.text-color-group h5 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.color-swatch-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.color-swatch-item:hover {
    background: rgba(248, 250, 252, 0.8);
    transform: translateX(2px);
}

.color-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.color-info {
    flex: 1;
    min-width: 0;
}

.color-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.color-value {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(30, 41, 59, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

/* Interactive Text Examples */
.interactive-text-examples {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(30, 41, 59, 0.1);
}

.interactive-text-examples h4 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.link-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.link-example {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-example a {
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.link-example-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Modern Tab Design */
.design-system-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.tab-button {
    flex: 1;
    min-width: 200px;
    padding: 1.5rem 2.5rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.08) 0%, rgba(51, 65, 85, 0.08) 100%);
    color: #475569;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(30, 41, 59, 0.15);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-button:hover {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.12) 0%, rgba(51, 65, 85, 0.12) 100%);
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: rgba(76, 29, 149, 0.2);
}

.tab-button:hover::before {
    opacity: 0.6;
}

.tab-button.active {
    background: linear-gradient(135deg, #4c1d95 0%, #312e81 50%, #1e1b4b 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 30px rgba(76, 29, 149, 0.3);
    transform: translateY(-2px);
}

.tab-button.active::before {
    opacity: 1;
    background: linear-gradient(90deg, #a855f7 0%, #ec4899 100%);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Tab Content */
.tab-content {
    min-height: 600px;
}

/* Colors Tab */
.colors-tab {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.color-editor-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

/* Public theme layout - preview below editor for more space */
.public-theme-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.color-preview-row {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.04) 0%, rgba(118, 75, 162, 0.04) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(10px);
    width: 100%;
}

.color-preview-row h3 {
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.color-editor {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.04) 0%, rgba(51, 65, 85, 0.04) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 41, 59, 0.1);
    backdrop-filter: blur(10px);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.editor-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Theme Controls Layout */
.theme-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-end;
    padding: 1rem 0;
}

.preset-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.save-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.apply-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(30, 41, 59, 0.1);
    display: flex;
    justify-content: center;
}

.apply-actions button {
    min-width: 180px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
    color: #ffffff !important;
}

.apply-actions button:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
    border-color: rgba(5, 150, 105, 0.5) !important;
    color: #ffffff !important;
}

/* Dropdown Styling */
.preset-dropdown {
    height: 46px;
    padding: 0 1rem;
    border: 2px solid rgba(76, 29, 149, 0.2);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.08) 0%, rgba(51, 65, 85, 0.08) 100%);
    color: #1e293b;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    min-width: 150px;
    line-height: 1.2;
}

.preset-dropdown:hover {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.12) 0%, rgba(51, 65, 85, 0.12) 100%);
    border-color: rgba(76, 29, 149, 0.3);
    box-shadow: 0 4px 12px rgba(76, 29, 149, 0.15);
}

.preset-dropdown:focus {
    outline: none;
    border-color: rgba(76, 29, 149, 0.5);
    box-shadow: 0 0 0 3px rgba(76, 29, 149, 0.1);
}

/* Theme Name Input */
.theme-name-input {
    height: 46px;
    padding: 0 1rem;
    border: 2px solid rgba(76, 29, 149, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    color: #1e293b;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    min-width: 180px;
    line-height: 1.2;
}

.theme-name-input:focus {
    outline: none;
    border-color: rgba(76, 29, 149, 0.5);
    box-shadow: 0 0 0 3px rgba(76, 29, 149, 0.1);
    background: #ffffff;
    color: #0f172a;
}

.theme-name-input::placeholder {
    color: #64748b;
}

/* Button Styling Updates */
.preset-controls-button,
.save-controls-button,
.preset-controls button,
.save-controls button {
    height: 46px;
    padding: 0 1.5rem;
    border: 2px solid rgba(76, 29, 149, 0.2);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.08) 0%, rgba(51, 65, 85, 0.08) 100%);
    color: #1e293b;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    line-height: 1.2;
}

.preset-controls-button:hover,
.save-controls-button:hover,
.preset-controls button:hover,
.save-controls button:hover {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.12) 0%, rgba(51, 65, 85, 0.12) 100%);
    border-color: rgba(76, 29, 149, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 29, 149, 0.15);
    color: #0f172a;
}

.preset-controls-button:active,
.save-controls-button:active,
.preset-controls button:active,
.save-controls button:active {
    transform: translateY(0);
}

/* Primary Save Button */
.save-theme-button {
    background: linear-gradient(135deg, #4c1d95 0%, #312e81 100%) !important;
    color: #ffffff !important;
    border-color: rgba(76, 29, 149, 0.3) !important;
}

.save-theme-button:hover {
    background: linear-gradient(135deg, #3730a3 0%, #1e1b4b 100%) !important;
    border-color: rgba(76, 29, 149, 0.5) !important;
    box-shadow: 0 4px 12px rgba(76, 29, 149, 0.25) !important;
    color: #ffffff !important;
}

.color-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.color-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.03) 0%, rgba(51, 65, 85, 0.03) 100%);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(30, 41, 59, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.color-group h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.color-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-input label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.color-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-input-group input[type="text"] {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.875rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.apply-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.color-preview {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.04) 0%, rgba(51, 65, 85, 0.04) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 41, 59, 0.1);
    height: fit-content;
    backdrop-filter: blur(10px);
}

.color-preview h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.color-preview-container {
    padding: 1.5rem;
    border-radius: 8px;
    min-height: 300px;
}

.preview-content h4 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.preview-content p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.preview-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.preview-buttons .btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.preview-card {
    border-radius: 8px;
}

.preview-card h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.preview-card p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Theme Status */
.theme-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.theme-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.theme-card h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.theme-colors {
    display: flex;
    gap: 0.5rem;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Typography Tab */
.typography-tab {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.04) 0%, rgba(51, 65, 85, 0.04) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 41, 59, 0.1);
    backdrop-filter: blur(10px);
}

.typography-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--primary-color);
}

.typography-header h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4c1d95 0%, #312e81 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typography-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

.typography-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
}

.typography-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.06) 0%, rgba(51, 65, 85, 0.04) 100%);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(30, 41, 59, 0.1);
    height: fit-content;
}

.font-family-selector,
.base-size-slider,
.line-height-slider {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.font-family-selector label,
.base-size-slider label,
.line-height-slider label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.font-family-selector select {
    padding: 0.75rem;
    border: 2px solid rgba(76, 29, 149, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.base-size-slider input[type="range"],
.line-height-slider input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.base-size-slider input[type="range"]::-webkit-slider-thumb,
.line-height-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.base-size-slider span,
.line-height-slider span {
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
}

.typography-preview {
    max-width: none;
}

.font-scale {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.font-example {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.03) 0%, rgba(51, 65, 85, 0.03) 100%);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(30, 41, 59, 0.08);
}

.font-example h1,
.font-example h2,
.font-example h3,
.font-example h4,
.font-example p,
.font-example small,
.font-example code {
    margin: 0 0 1rem 0;
}

.font-specs {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(30, 41, 59, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    margin-top: 0.75rem;
}

.font-example h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.font-example h2 {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

.font-example h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.font-example h4 {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
}

.font-example p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.font-example small {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.font-example code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    background: rgba(30, 41, 59, 0.08);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--text-primary);
}

.spacing-system {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.03) 0%, rgba(51, 65, 85, 0.03) 100%);
    border-radius: 16px;
    border: 1px solid rgba(30, 41, 59, 0.08);
}

.spacing-system h4 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.spacing-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.spacing-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(30, 41, 59, 0.05);
}

.spacing-demo {
    width: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    opacity: 0.7;
}

.spacing-item span {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Spacing Tab */
.spacing-tab {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.spacing-tab h3 {
    margin: 0 0 2rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.spacing-scale {
    max-width: 600px;
}

.spacing-example {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

/* Components Tab */
.components-tab {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.components-tab h3 {
    margin: 0 0 2rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.component-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Preview Tab */
.preview-tab {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.04) 0%, rgba(51, 65, 85, 0.04) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 41, 59, 0.1);
    backdrop-filter: blur(10px);
}

.preview-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--primary-color);
}

.preview-header h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4c1d95 0%, #312e81 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.preview-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.preview-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.06) 0%, rgba(51, 65, 85, 0.04) 100%);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(30, 41, 59, 0.1);
}

.admin-preview-section {
    border-color: rgba(76, 29, 149, 0.2);
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.06) 0%, rgba(49, 46, 129, 0.04) 100%);
}

.public-preview-section {
    border-color: rgba(30, 41, 59, 0.2);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.06) 0%, rgba(71, 85, 105, 0.04) 100%);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.section-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.preview-actions {
    display: flex;
    gap: 0.75rem;
}

.preview-action-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-action-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.component-showcase {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(30, 41, 59, 0.1);
}

.preview-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(30, 41, 59, 0.1);
}

.theme-comparison {
    text-align: center;
}

.theme-comparison h4 {
    margin: 0 0 2rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.theme-sample {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(30, 41, 59, 0.1);
}

.sample-header {
    padding: 1.5rem;
    text-align: center;
}

.sample-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.sample-content {
    padding: 1.5rem;
    text-align: center;
}

.sample-colors {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sample-content p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Preview Container Styles */
.admin-preview .preview-content {
    padding: 1.5rem;
}

.public-preview .preview-content {
    padding: 1.5rem;
}

.preview-header {
    margin-bottom: 1rem;
}

/* Admin and Public Component Previews */
.admin-components .component-demo {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(100, 116, 139, 0.05) 100%);
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.public-components .component-demo {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.02) 0%, rgba(102, 102, 102, 0.02) 100%);
    border: 1px solid rgba(26, 26, 26, 0.1);
}

.component-demo {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.component-demo h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.component-demo .form-group {
    margin-bottom: 1rem;
}

.component-demo .form-group:last-child {
    margin-bottom: 0;
}

.component-demo .card {
    margin: 0;
}

.component-demo .card-header {
    margin-bottom: 1rem;
}

.component-demo .card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .color-editor-layout {
        grid-template-columns: 1fr;
    }
    
    .color-groups {
        grid-template-columns: 1fr;
    }
    
    .component-preview-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .design-system-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-button {
        text-align: center;
        min-width: unset;
        padding: 1rem 1.5rem;
    }
    
    .theme-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    
    .preset-controls,
    .save-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .preset-dropdown,
    .theme-name-input {
        min-width: unset;
        width: 100%;
    }
    
    .editor-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    
    .editor-header h3 {
        text-align: center;
    }
    
    .theme-status {
        grid-template-columns: 1fr;
    }
    
    .apply-actions {
        flex-direction: column;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .color-editor,
    .color-preview {
        padding: 1rem;
    }
    
    .preview-section {
        gap: 1rem;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    /* Main container backgrounds */
    .theme-tab {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.15) 0%, rgba(51, 65, 85, 0.12) 100%) !important;
        border-color: rgba(148, 163, 184, 0.2) !important;
    }
    
    .color-editor,
    .color-preview {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.12) 0%, rgba(51, 65, 85, 0.10) 100%) !important;
        border-color: rgba(148, 163, 184, 0.15) !important;
    }
    
    .color-group {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.08) 0%, rgba(51, 65, 85, 0.06) 100%) !important;
        border-color: rgba(148, 163, 184, 0.1) !important;
    }
    
    /* Tab buttons */
    .tab-button {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.15) 0%, rgba(51, 65, 85, 0.12) 100%) !important;
        color: #cbd5e1 !important;
        border-color: rgba(148, 163, 184, 0.2) !important;
    }
    
    .tab-button:hover {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.2) 0%, rgba(51, 65, 85, 0.18) 100%) !important;
        color: #f1f5f9 !important;
        border-color: rgba(76, 29, 149, 0.3) !important;
    }
    
    /* Input fields */
    .preset-dropdown,
    .theme-name-input {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.12) 0%, rgba(51, 65, 85, 0.10) 100%) !important;
        color: #f1f5f9 !important;
        border-color: rgba(148, 163, 184, 0.2) !important;
    }
    
    .theme-name-input:focus {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.18) 0%, rgba(51, 65, 85, 0.15) 100%) !important;
        color: #ffffff !important;
    }
    
    .theme-name-input::placeholder {
        color: #94a3b8 !important;
    }
    
    /* Buttons */
    .preset-controls-button,
    .save-controls-button,
    .preset-controls button,
    .save-controls button {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.12) 0%, rgba(51, 65, 85, 0.10) 100%) !important;
        color: #f1f5f9 !important;
        border-color: rgba(148, 163, 184, 0.2) !important;
    }
    
    .preset-controls-button:hover,
    .save-controls-button:hover,
    .preset-controls button:hover,
    .save-controls button:hover {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.18) 0%, rgba(51, 65, 85, 0.15) 100%) !important;
        color: #ffffff !important;
    }
    
    /* Preview content */
    .color-preview-container {
        color: #ffffff !important;
    }
    
    .preview-content h4 {
        color: #ffffff !important;
    }
    
    .preview-content p {
        color: #e2e8f0 !important;
    }
    
    .spacing-example {
        background: #374151 !important;
        color: #d1d5db !important;
    }
    
    /* Color input groups */
    .color-input-group {
        background: rgba(30, 41, 59, 0.1) !important;
        border-color: rgba(148, 163, 184, 0.15) !important;
    }
    
    /* Apply actions in dark mode */
    .apply-actions {
        border-color: rgba(148, 163, 184, 0.2) !important;
    }
}

/* Compact Grid Layout for Text Preview */
.text-hierarchy-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
    .text-hierarchy-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .text-hierarchy-grid {
        grid-template-columns: 1fr;
    }
}

.text-column {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(30, 41, 59, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.text-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: rgba(102, 126, 234, 0.3);
}

.text-column h4 {
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    background: linear-gradient(135deg, #4c1d95 0%, #312e81 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-sample-compact {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(248, 250, 252, 0.7);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s ease;
}

.text-sample-compact:hover {
    background: rgba(248, 250, 252, 1);
    border-left-color: var(--accent-color);
}

.var-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    background: rgba(30, 41, 59, 0.08);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.semantic-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.semantic-item {
    padding: 0.6rem;
    background: rgba(248, 250, 252, 0.7);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.semantic-item:hover {
    background: rgba(248, 250, 252, 1);
    transform: translateX(2px);
}

.header-footer-preview {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(30, 41, 59, 0.1);
    backdrop-filter: blur(5px);
}

.header-footer-preview h4 {
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    background: linear-gradient(135deg, #4c1d95 0%, #312e81 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Typography Controls */
.font-family-selector,
.base-size-slider,
.line-height-slider,
.font-weight-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.font-family-selector select,
.font-weight-selector select {
    padding: 0.875rem 1rem;
    border: 2px solid rgba(30, 41, 59, 0.15);
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.font-family-selector select:focus,
.font-weight-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.font-family-selector optgroup {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    padding: 0.5rem 0;
}

.font-family-selector option {
    padding: 0.5rem;
    font-weight: 400;
}

/* Enhanced Typography Preview */
.font-info-panel {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 2px solid #0ea5e9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.font-info-panel h4 {
    color: #0c4a6e;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.font-current-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.font-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.info-label {
    font-size: 0.9rem;
    color: #0c4a6e;
    font-weight: 600;
}

.info-value {
    font-size: 0.9rem;
    color: #0369a1;
    font-weight: 700;
    font-family: "SF Mono", "Monaco", monospace;
    background: rgba(14, 165, 233, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.font-example.pixel-demo {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #00ff41;
    border-color: #00ff41;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.font-example.pixel-demo div:first-child {
    text-shadow: 0 0 15px #00ff41, 0 0 30px #00ff41;
    letter-spacing: 3px;
    animation: pixelGlow 2s ease-in-out infinite alternate;
}

@keyframes pixelGlow {
    from {
        text-shadow: 0 0 15px #00ff41, 0 0 30px #00ff41;
    }
    to {
        text-shadow: 0 0 20px #00ff41, 0 0 40px #00ff41, 0 0 60px #00ff41;
    }
}

.pixel-demo .font-specs {
    color: #00ff41;
    border-top-color: #00ff41;
    background: rgba(0, 255, 65, 0.1);
    opacity: 0.9;
}
