/* =========================================
   Gradient Animation - Plugin Styles
   ========================================= */

/* Scoped base styles for the app wrapper */
#gradient-app-wrapper {
    font-family: 'Inter', system-ui, sans-serif;
    color: #0f172a;
}

#gradient-app-wrapper * {
    box-sizing: border-box;
}

/* Custom Color Input Overrides */
#gradient-app-wrapper input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}
#gradient-app-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
#gradient-app-wrapper input[type="color"]::-webkit-color-swatch {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

/* Canvas Container */
#gradient-app-wrapper .canvas-container {
    position: relative;
    background-color: #000000;
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
}

#gradient-app-wrapper #renderCanvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

/* Custom Scrollbars for the Left Panel */
#gradient-app-wrapper .controls-panel::-webkit-scrollbar {
    width: 6px;
}
#gradient-app-wrapper .controls-panel::-webkit-scrollbar-track {
    background: #f1f5f9;
}
#gradient-app-wrapper .controls-panel::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}

/* =========================================
   Dynamic Color Palette Items
   ========================================= */
/* 1. The wrapper for each color */
#gradient-app-wrapper .color-item {
    position: relative;
    width: 48px;
    height: 48px;
    transition: all 0.2s;
}

/* 2. The actual color square */
#gradient-app-wrapper .color-item input[type="color"] {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 3. The pop-out animation when you hover over a color */
#gradient-app-wrapper .color-item:hover {
    transform: scale(1.08);
    z-index: 10;
}

/* 4. The overlapping red 'X' button */
#gradient-app-wrapper .color-item .delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: background 0.2s;
}

/* 5. Darker red when hovering over the 'X' */
#gradient-app-wrapper .color-item .delete-btn:hover {
    background: #dc2626;
}

/* =========================================
   Header Animations
   ========================================= */
/* Gradient Title Animation */
@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
#gradient-app-wrapper .animate-gradient-text {
    background-size: 200% auto;
    animation: moveGradient 3s linear infinite;
}

/* Owl Eye Blink Animation */
@keyframes owlBlink {
    0%, 95%, 98%, 100% { transform: scaleY(1); }
    96%, 97% { transform: scaleY(0.1); }
}
#gradient-app-wrapper .owl-eye {
    transform-origin: 50% 50%;
    transform-box: fill-box;
    animation: owlBlink 4s infinite normal;
}

/* =========================================
   Thumbnail Scroll Window & Grid Styles
   ========================================= */
#gradient-app-wrapper #thumbnailScrollArea::-webkit-scrollbar { width: 6px; }
#gradient-app-wrapper #thumbnailScrollArea::-webkit-scrollbar-track { background: #f8fafc; border-radius: 4px; }
#gradient-app-wrapper #thumbnailScrollArea::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
#gradient-app-wrapper #thumbnailScrollArea::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

#gradient-app-wrapper .thumb-item {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    overflow: hidden;
    width: 100%;
    height: 100%; /* Fills the rigid 60px slot */
    background-color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

#gradient-app-wrapper .thumb-item:hover { 
    transform: scale(1.05); 
    z-index: 10; 
    border-color: #f97316; /* Saffron hover */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
}

#gradient-app-wrapper .thumb-item.active { 
    border-color: #ea580c; 
    border-width: thick;
}

#gradient-app-wrapper .thumb-img { 
    position: absolute;
    top: 0; left: 0;
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    opacity: 0; 
    transition: opacity 0.3s; 
    z-index: 1;
}

#gradient-app-wrapper .thumb-img.loaded { 
    opacity: 1; 
}

#gradient-app-wrapper .thumb-loading-text {
    position: absolute;
    color: #64748b;
    font-size: 0.6rem;
    font-weight: bold;
    z-index: 0;
}

/* =========================================
   Frontend Post Display & Buttons
   ========================================= */
.gradient-post-container {
    width: 100%;
    margin-bottom: 2rem;
}

.gradient-actions-wrapper .btn-repost:hover, 
.gradient-actions-wrapper .btn-download-video:hover,
.gradient-actions-wrapper .btn-download-image:hover {
    filter: brightness(1.1);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #1f2937 !important;
}

.gradient-actions-wrapper .btn-repost:active, 
.gradient-actions-wrapper .btn-download-video:active,
.gradient-actions-wrapper .btn-download-image:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #1f2937 !important;
}

.gradient-render-target canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}