/* Main Styles for Buildify */

/* Base Styles */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #f3f4f6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --black: #000000;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border-radius: 0.375rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
.dark {
    --secondary-color: #1f2937;
    --text-color: #f9fafb;
    --text-light: #d1d5db;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
button, .btn {
    cursor: pointer;
    transition: var(--transition);
}

/* Feature Cards */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

/* Component Cards */
.component-card .component-preview {
    transition: transform 0.3s ease;
}

.component-card:hover .component-preview {
    transform: scale(1.05);
}

/* Template Cards */
.template-card img {
    transition: transform 0.3s ease;
}

.template-card:hover img {
    transform: scale(1.05);
}

/* Builder Section */
#preview-container {
    min-height: 300px;
    transition: background-color 0.3s ease;
}

#code-container {
    min-height: 300px;
}

/* Code Highlighting */
pre {
    border-radius: var(--border-radius);
    overflow-x: auto;
}

code {
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
}

/* Modal */
#component-modal {
    transition: opacity 0.3s ease;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Component Customization */
.structure-selector.active,
.style-selector.active,
.functionality-selector.active {
    background-color: var(--primary-color);
    color: var(--white);
}

#component-customization {
    transition: opacity 0.3s ease;
}

/* Utility Classes */
.hidden {
    display: none;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form Elements */
input, select, textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Custom Focus Styles */
a:focus, button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.4);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}