/* ============================================================
   PLIK: gradientsandcolors.css (v4 - REFACTORED & UNIFIED)
   Opis: Wszystkie style CSS dla całego systemu towarto.pl
   Użycie: appearance.php, dashboard.php, kreator.html, profile.php
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Playfair+Display:wght@400;700&family=Roboto+Mono:wght@400;700&family=Poppins:wght@400;700&family=Montserrat:wght@400;700&family=Lato:wght@400;700&family=Oswald:wght@400;700&family=Raleway:wght@400;700&family=Patrick+Hand&family=Fredoka:wght@400;600&family=Bangers&display=swap&subset=latin,latin-ext');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    --user-bg: #f9fafb;
    --card-bg: transparent;
    --card-shadow: none;
    --card-border: none;
    --body-bg: var(--user-bg);
}

/* ============================================================
   IMAGE STUDIO - MASKS & FILTERS
   ============================================================ */
.mask-circle { border-radius: 50%; }
.mask-squircle { border-radius: 20%; }
.mask-blob { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
.mask-hexagon { 
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); 
    border-radius: 0 !important; 
}

.filter-grayscale { filter: grayscale(100%); }
.filter-sepia { filter: sepia(80%); }
.filter-vintage { filter: sepia(40%) contrast(120%) brightness(90%); }
.filter-noir { filter: grayscale(100%) contrast(150%); }
.filter-cool { filter: hue-rotate(30deg) contrast(110%); }
.filter-warm { filter: sepia(30%) saturate(140%); }
.filter-fade { filter: opacity(60%); }

/* ============================================================
   ANIMATIONS (ALWAYS ON)
   ============================================================ */
@keyframes pulse-glow { 
    0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4); } 
    70% { box-shadow: 0 0 0 15px rgba(0,0,0,0); } 
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } 
}
@keyframes float { 
    0%, 100% { transform: translateY(0); } 
    50% { transform: translateY(-10px); } 
}
@keyframes spin-slow { 
    from { transform: rotate(0deg); } 
    to { transform: rotate(360deg); } 
}
@keyframes glitch { 
    0% { transform: translate(0); } 
    20% { transform: translate(-2px, 2px); } 
    40% { transform: translate(-2px, -2px); } 
    60% { transform: translate(2px, 2px); } 
    80% { transform: translate(2px, -2px); } 
    100% { transform: translate(0); } 
}
@keyframes rainbow { 
    0% { border-color: red; } 
    20% { border-color: orange; } 
    40% { border-color: yellow; } 
    60% { border-color: green; } 
    80% { border-color: blue; } 
    100% { border-color: violet; } 
}
@keyframes heartbeat { 
    0% { transform: scale(1); } 
    15% { transform: scale(1.1); } 
    30% { transform: scale(1); } 
    45% { transform: scale(1.1); } 
    60% { transform: scale(1); } 
}

.anim-pulse { animation: pulse-glow 2s infinite; }
.anim-float { animation: float 3s infinite ease-in-out; }
.anim-spin { animation: spin-slow 10s linear infinite; }
.anim-glitch { animation: glitch 3s cubic-bezier(.25, .46, .45, .94) both infinite; }
.anim-heartbeat { animation: heartbeat 1.5s infinite; }
.anim-rainbow { 
    animation: rainbow 2s linear infinite; 
    border-width: 4px !important; 
    border-style: solid; 
}

/* ============================================================
   BIO TEXT EFFECTS
   ============================================================ */
@keyframes typing { from { width: 0; } to { width: 100%; } }
@keyframes blink { 50% { border-color: transparent; } }
@keyframes blur-in { 
    from { filter: blur(10px); opacity: 0; } 
    to { filter: blur(0); opacity: 1; } 
}
@keyframes blink-text { 50% { opacity: 0; } }

.bio-typewriter { 
    border-right: 2px solid; 
    white-space: nowrap; 
    overflow: hidden; 
    animation: typing 3s steps(30, end), blink .75s step-end infinite; 
    display: inline-block; 
    max-width: 100%; 
}
.bio-marker { 
    background: linear-gradient(120deg, #f6d365 0%, #fda085 100%); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    font-weight: 800; 
}
.bio-shadow { text-shadow: 2px 2px 0px rgba(0,0,0,0.15); }
.bio-spaced { 
    letter-spacing: 3px; 
    text-transform: uppercase; 
    font-size: 0.7em; 
    font-weight: 800; 
}
.bio-blur { animation: blur-in 1.5s forwards; }
.bio-blink { animation: blink-text 1s infinite; }
.bio-none { /* default, no special effect */ }

/* ============================================================
   ANIME.JS ML EFFECTS
   ============================================================ */
.ml2 .letter, 
.ml3 .letter, 
.ml6 .letter, 
.ml7 .letter { 
    display: inline-block; 
    line-height: 1em; 
}
.ml6, .ml7 { 
    position: relative; 
    font-weight: 900; 
}
.ml6 .text-wrapper, 
.ml7 .text-wrapper { 
    position: relative; 
    display: inline-block; 
    padding-top: 0.2em; 
    padding-right: 0.05em; 
    padding-bottom: 0.1em; 
    overflow: hidden; 
}
.ml7 .letter { transform-origin: 0 100%; }

/* ============================================================
   UI COMPONENTS - SHARED
   ============================================================ */
.color-preset { 
    width: 28px; 
    height: 28px; 
    border-radius: 6px; 
    cursor: pointer; 
    border: 2px solid #eee; 
    transition: all 0.2s; 
}
.color-preset:hover { transform: scale(1.1); }
.color-preset.selected { 
    border-color: #db2777; 
    transform: scale(1.15); 
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); 
}

.bg-preset-wide { 
    height: 60px; 
    width: 100%; 
    border-radius: 8px; 
    cursor: pointer; 
    border: 2px solid #eee; 
    transition: 0.2s; 
}
.bg-preset-wide:hover { transform: scale(1.02); }
.bg-preset-wide.selected { 
    border-color: #db2777; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    transform: scale(1.03); 
}

/* ============================================================
   PANEL CARDS (appearance.php, kreator.html)
   ============================================================ */
.panel-card { 
    background: white; 
    border-radius: 1rem; 
    border: 1px solid #e5e7eb; 
    padding: 1.5rem; 
    margin-bottom: 1.5rem; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); 
}
.label-head { 
    font-size: 1.125rem; 
    font-weight: 800; 
    color: #111827; 
    margin-bottom: 1.5rem; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
}
.label-sm { 
    display: block; 
    font-size: 0.75rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    color: #6b7280; 
    margin-bottom: 0.5rem; 
}
.inp-std { 
    width: 100%; 
    border: 1px solid #d1d5db; 
    border-radius: 0.5rem; 
    padding: 0.5rem; 
    font-size: 0.875rem; 
    outline: none; 
    transition: border-color 0.2s; 
}
.inp-std:focus { 
    border-color: #db2777; 
    ring: 1px solid #db2777; 
}

/* ============================================================
   LAYOUT MODE TILES (appearance.php, kreator.html)
   ============================================================ */
.layout-option { 
    border: 2px solid #e5e7eb; 
    border-radius: 12px; 
    padding: 12px; 
    cursor: pointer; 
    transition: all 0.2s; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    height: 100%; 
}
.layout-option:hover { 
    border-color: #d1d5db; 
    background: #f9fafb; 
}
.layout-option.active { 
    border-color: #db2777; 
    background: #fdf2f8; 
    color: #be185d; 
}
.layout-icon { 
    font-size: 24px; 
    margin-bottom: 8px; 
}
.layout-name { 
    font-size: 11px; 
    font-weight: bold; 
}
.layout-desc { 
    font-size: 9px; 
    opacity: 0.7; 
    text-align: center; 
    line-height: 1.2; 
    margin-top: 4px; 
}

/* ============================================================
   GRADIENTS
   ============================================================ */
.grad-sunset { background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); }
.grad-ocean { background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%); }
.grad-candy { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%); }
.grad-midnight { background: linear-gradient(to top, #30cfd0 0%, #330867 100%); }
.grad-forest { background: linear-gradient(120deg, #d4fc79 0%, #96e6a1 100%); }
.grad-dark { background: linear-gradient(135deg, #232526 0%, #414345 100%); }
.grad-fire { background: linear-gradient(120deg, #f093fb 0%, #f5576c 100%); }
.grad-space { background: linear-gradient(to right, #434343 0%, black 100%); }
.grad-dusk { background: linear-gradient(to top, #5f72bd 0%, #9b23ea 100%); }
.grad-lime { background: linear-gradient(to right, #f09819 0%, #edde5d 100%); }
.grad-sky { background: linear-gradient(to top, #a18cd1 0%, #fbc2eb 100%); }
.grad-cherry { background: linear-gradient(to top, #eb3349 0%, #f45c43 100%); }

/* ============================================================
   SCROLLBARS
   ============================================================ */
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-thumb { 
    background: #cbd5e1; 
    border-radius: 3px; 
}
.phone-scroll::-webkit-scrollbar { width: 4px; }
.phone-scroll::-webkit-scrollbar-thumb { 
    background: #ddd; 
    border-radius: 4px; 
}

/* ============================================================
   CROPPER CUSTOMIZATION
   ============================================================ */
.cropper-view-box, 
.cropper-face { 
    border-radius: 50%; 
}

/* ============================================================
   DESKTOP LAYOUTS (>768px)
   ============================================================ */
body { 
    background: var(--body-bg); 
}
.profile-container { 
    background: var(--card-bg); 
    box-shadow: var(--card-shadow); 
    border: var(--card-border); 
}

@media (min-width: 768px) {
    /* SPOTIFY MODE */
    body.mode-spotify { 
        --body-bg: var(--user-bg); 
    }
    body.mode-spotify::before { 
        content: ''; 
        position: fixed; 
        inset: -20px; 
        background: var(--user-bg); 
        filter: blur(40px) brightness(0.7); 
        z-index: -1; 
    }
    body.mode-spotify .profile-container { 
        background: transparent; 
        box-shadow: none; 
    }

    /* NEUTRAL MODE */
    body.mode-neutral { 
        --body-bg: #e5e7eb; 
    }
    body.mode-neutral .profile-container { 
        background: var(--user-bg); 
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); 
        border-radius: 24px; 
        margin-top: 40px; 
        margin-bottom: 40px; 
    }

    /* GLASS MODE */
    body.mode-glass { 
        --body-bg: var(--user-bg); 
    }
    body.mode-glass .profile-container { 
        background: rgba(255, 255, 255, 0.1); 
        backdrop-filter: blur(12px); 
        border: 1px solid rgba(255, 255, 255, 0.2); 
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15); 
        border-radius: 24px; 
        margin-top: 40px; 
        margin-bottom: 40px; 
    }
}

/* ============================================================
   DASHBOARD SPECIFIC STYLES
   ============================================================ */
.sortable-ghost { 
    opacity: 0.4; 
    background: #FFF7ED; 
    border: 2px dashed #F97316; 
}
.sortable-drag { 
    cursor: grabbing; 
}
.blur-content { 
    filter: blur(5px); 
    opacity: 0.6; 
    pointer-events: none; 
    user-select: none; 
}
.locked-field { 
    position: relative; 
    filter: grayscale(0.5) opacity(0.6); 
    pointer-events: none; 
}

/* ============================================================
   PROFILE SPECIFIC STYLES
   ============================================================ */
.dashed-border { 
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23EA580CFF' stroke-width='2' stroke-dasharray='10%2c 10' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e"); 
    border-radius: 12px; 
}
.social-icon { 
    font-size: 1.6rem; 
    opacity: 0.85; 
    transition: transform 0.2s; 
    color: inherit; 
}
.social-icon:hover { 
    transform: scale(1.15); 
    opacity: 1; 
}
.anim-pop:active { 
    transform: scale(0.98); 
}
@keyframes shake { 
    0%, 100% { transform: translateX(0); } 
    25% { transform: translateX(-5px); } 
    75% { transform: translateX(5px); } 
}
.shake-anim { 
    animation: shake 0.3s ease-in-out; 
    border-color: red !important; 
}

/* ============================================================
   PRODUCT IMAGE SUPPORT
   ============================================================ */
.product-image-preview {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}
.product-image-upload-btn {
    position: relative;
    overflow: hidden;
    display: inline-block;
}
.product-image-upload-btn input[type=file] {
    position: absolute;
    left: -9999px;
}
