/**
 * CreateYou Designer - UX Enhancements CSS
 */

/* ===== TOAST NOTIFICATIONS ===== */
.cy-toast {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid #ccc;
}

.cy-toast-show {
    opacity: 1;
    transform: translateX(0);
}

.cy-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.cy-toast-content i {
    font-size: 20px;
}

.cy-toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.cy-toast-close:hover {
    background: #f0f0f0;
    color: #333;
}

.cy-toast-success {
    border-left-color: #2ecc71;
}

.cy-toast-success .cy-toast-content i {
    color: #2ecc71;
}

.cy-toast-error {
    border-left-color: #e74c3c;
}

.cy-toast-error .cy-toast-content i {
    color: #e74c3c;
}

.cy-toast-warning {
    border-left-color: #f39c12;
}

.cy-toast-warning .cy-toast-content i {
    color: #f39c12;
}

.cy-toast-info {
    border-left-color: #3498db;
}

.cy-toast-info .cy-toast-content i {
    color: #3498db;
}

/* ===== DRAG & DROP HIGHLIGHT ===== */
.cy-drag-highlight {
    border: 3px dashed #00AEEF !important;
    background: rgba(0, 174, 239, 0.05) !important;
}

.cy-drag-highlight::after {
    content: '📁 Húzd ide a képet!';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #00AEEF;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== UNDO/REDO BUTTONS ===== */
.cy-history-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cy-history-btn:hover:not(:disabled) {
    background: #f0f9ff;
    border-color: #00AEEF;
    color: #00AEEF;
    transform: none;
}

.cy-history-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cy-history-btn i {
    font-size: 16px;
}

/* ===== LAYERS PANEL ===== */
.cy-layers-panel {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.cy-layers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.cy-layers-title {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    color: #555;
    letter-spacing: 0.5px;
}

.cy-layers-list {
    overflow-y: auto;
    flex: 1;
}

.cy-layer-item {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.cy-layer-item:hover {
    background: #f0f9ff;
    border-color: #00AEEF;
    transform: none;
}

.cy-layer-item.active {
    background: #e0f7fa;
    border-color: #00AEEF;
    box-shadow: 0 2px 8px rgba(0,174,239,0.2);
}

.cy-layer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.cy-layer-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cy-layer-actions {
    display: flex;
    gap: 4px;
}

.cy-layer-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.cy-layer-btn:hover {
    background: #f0f0f0;
    border-color: #00AEEF;
    color: #00AEEF;
}

.cy-layer-btn.cy-layer-delete:hover {
    background: #fff5f5;
    border-color: #e74c3c;
    color: #e74c3c;
}

/* ===== TEXT EFFECTS PANEL ===== */
.cy-effects-panel {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.cy-effects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.cy-effect-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cy-effect-btn:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cy-effect-btn.shadow {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.cy-effect-btn.stroke {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.cy-effect-btn.remove {
    background: #f0f0f0;
    color: #e74c3c;
}

.cy-effect-btn.remove:hover {
    background: #fff5f5;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

/* ===== SAVED COLORS PALETTE ===== */
.cy-saved-colors-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.cy-saved-colors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cy-saved-colors-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
}

.cy-save-color-btn {
    background: #00AEEF;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cy-save-color-btn:hover {
    background: #008FCC;
    transform: none;
}

#cy-saved-colors-palette {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 30px;
    align-items: center;
}

.cy-saved-color-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ddd, 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.cy-saved-color-btn:hover {
    transform: none;
    box-shadow: 0 0 0 2px #00AEEF, 0 4px 8px rgba(0,0,0,0.2);
}

/* ===== SMOOTH ANIMATIONS ===== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.cy-animate-in {
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cy-panel {
    animation: fadeIn 0.3s ease-out;
}

/* ===== LOADING OVERLAY ===== */
.cy-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff !important;
    backdrop-filter: none !important;
    z-index: 999998;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
}

.cy-loading-overlay.active {
    display: flex;
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.cy-loading-box {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.15);
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    max-width: 420px;
    width: calc(100% - 40px);
}

.cy-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top-color: #00AEEF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cy-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #0B151A !important;
    text-align: center;
    opacity: 1 !important;
}

/* ===== HELP TOOLTIP ===== */
.cy-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 999999;
    max-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ===== KEYBOARD SHORTCUTS HELP ===== */
.cy-shortcuts-panel {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-width: 400px;
}

.cy-shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cy-shortcut-item:last-child {
    border-bottom: none;
}

.cy-shortcut-key {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 11px;
    font-weight: bold;
    color: #555;
}

.cy-shortcut-desc {
    font-size: 13px;
    color: #666;
}

/* ===== ENHANCED CONTROLS ===== */
.cy-enhanced-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.cy-control-group {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px;
    flex: 1;
    min-width: 150px;
}

.cy-control-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 8px;
    display: block;
}

.cy-control-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.cy-control-input:focus {
    outline: none;
    border-color: #00AEEF;
    box-shadow: 0 0 0 3px rgba(0,174,239,0.1);
}

/* ===== AUTOSAVE INDICATOR ===== */
.cy-autosave-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 999997;
}

.cy-autosave-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.cy-autosave-indicator i {
    color: #2ecc71;
}

/* ===== ENHANCED BUTTON EFFECTS ===== */
.cy-btn-block,
.cy-tool-btn,
.cf-btn {
    position: relative;
    overflow: hidden;
}

.cy-btn-block::before,
.cy-tool-btn::before,
.cf-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cy-btn-block:active::before,
.cy-tool-btn:active::before,
.cf-btn:active::before {
    width: 300px;
    height: 300px;
}

/* ===== SMOOTH TRANSITIONS ===== */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.cy-panel,
.cy-color-item,
.cy-pill,
.cy-landing-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== IMPROVED FOCUS STATES ===== */
input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: 2px solid #00AEEF;
    outline-offset: 2px;
}

/* ===== PROGRESS BAR ===== */
.cy-progress-bar {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.cy-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00AEEF, #667eea);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ===== CRITICAL MOBILE PERFORMANCE FIX ===== */
@media (max-width: 768px) {
    /* CRITICAL: Ensure page is NEVER blocked */
    body {
        pointer-events: auto !important;
        touch-action: manipulation !important;
        overflow-x: hidden;
    }
    
    /* CRITICAL: Remove ALL blocking overlays immediately */
    .cy-loading-overlay:not(.active) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: -1 !important;
    }
    
    .cy-mobile-overlay:not(.active) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: -1 !important;
    }
    
    /* Better touch targets on mobile */
    button:not(:disabled),
    input[type="button"]:not(:disabled),
    input[type="submit"]:not(:disabled),
    .cy-btn-block,
    .cy-tool-btn,
    .cf-btn,
    .cy-upload-templates-btn {
        touch-action: manipulation;
        pointer-events: auto;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 174, 239, 0.2);
    }
    
    /* Disable expensive effects on mobile */
    * {
        will-change: auto !important;
    }
    
    /* Reduce backdrop-filter for performance */
    .cy-panel,
    .cy-top-bar,
    .cy-controls-bar {
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }
    
    /* Reduce animation complexity on mobile for better performance */
    .cy-btn-block::before,
    .cy-tool-btn::before,
    .cf-btn::before {
        transition: none !important;
    }
    
    /* Optimize button hover effects for touch devices */
    .cy-btn-block:active,
    .cy-tool-btn:active,
    .cf-btn:active {
        transform: scale(0.98);
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    /* Further optimize for small screens */
    .cy-btn-block,
    .cy-tool-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* ===== HIDE PROPERTIES PANEL ON MOBILE ===== */
@media (max-width: 768px) {
    /* Hide properties panel completely on mobile */
    .cy-properties-section,
    #cy-properties-panel,
    .cy-bottom-section.cy-properties-section,
    div[id="cy-properties-panel"],
    .cy-prop-header-compact,
    .cy-prop-row-compact,
    .cy-prop-group-compact,
    .cy-nudge-container-compact {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* Hide properties section container */
    .cy-bottom-panel-content .cy-properties-section,
    .cy-bottom-panel-content #cy-properties-panel {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Ensure bottom panel doesn't show empty space when only properties would be shown */
    .cy-bottom-panel-content:has(.cy-properties-section:only-child) {
        display: none !important;
    }
}



