/* ============================================
   CreArtHub - Base Styles
   ============================================ */

/* CSS Variables */
:root {
    /* Colors */
    --color-bg: #EAEAEA;
    --color-bg-secondary: #dfdde8;
    --color-bg-tertiary: #cccad7;
    --color-white: #ffffff;
    --color-text: rgb(47, 47, 47);
    --color-text-muted: #6b7280;
    --color-primary: #ac10ea;
    --color-primary-dark: #530493;
    --color-primary-darker: #8a0dc2;
    --color-border: #e5e7eb;
    --color-border-dark: #d1d5db;
    --color-error: #dc2626;
    --color-success: #10b981;

    /* Typography */
    --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-secondary: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Layout */
    --container-max: 1300px;
    --container-padding: 20px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Тёмная тема (минимальная поддержка) */
body[data-theme="dark"] {
    background: #050509;
    color: #f5f5f5;
}

body[data-theme="dark"] a {
    color: #e0b3ff;
}

body[data-theme="dark"] .settings-page,
body[data-theme="dark"] .profile-page {
    background-color: #050509;
}

/* Main content should take available space */
main {
    flex: 1;
}

/* Container */
.container {
    width: 100%;
    max-width: calc(var(--container-max) + var(--container-padding) * 2);
    margin: 0 auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

h4 {
    font-size: 18px;
}

p {
    margin: 0;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: var(--color-primary);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lists */
ul, ol {
    list-style: none;
}

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
}

/* Forms */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* Utility Classes */
.text-muted {
    color: var(--color-text-muted);
}

.text-primary {
    color: var(--color-primary);
}

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

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

/* ============================================
   Font Loading
   ============================================ */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Montserrat Regular'), local('Montserrat-Regular');
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: local('Montserrat Medium'), local('Montserrat-Medium');
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: local('Montserrat SemiBold'), local('Montserrat-SemiBold');
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: local('Montserrat Bold'), local('Montserrat-Bold');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Poppins Regular'), local('Poppins-Regular');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: local('Poppins Medium'), local('Poppins-Medium');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: local('Poppins SemiBold'), local('Poppins-SemiBold');
}

/* ============================================
   Responsive Utilities
   ============================================ */
@media (max-width: 768px) {
    :root {
        --container-padding: 15px;
    }

    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    :root {
        --container-padding: 12px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }
}

/* Скрытие элементов экспорта/инструментов разработки */
.export-element-active,
.inherited-css,
.export-element-active.inherited-css {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}