/* ==========================================================================
   pixxu.net - Favicon Generator CSS
   Spezifische Styles für den Favicon Generator
   ========================================================================== */

/* ==========================================================================
   FAVICON GENERATOR SPECIFIC STYLES
   ========================================================================== */

/* Original image preview container */
.original-container {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.original-container:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

#originalImage {
    max-width: 200px;
    max-height: 200px;
    display: block;
    border-radius: inherit;
}

/* Image overlay with information */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.original-container:hover .image-overlay {
    transform: translateY(0);
}

.overlay-info {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================================================
   FAVICON GRID & PREVIEW
   ========================================================================== */

.favicon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.favicon-item {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.favicon-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.favicon-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.favicon-item:hover::before {
    transform: scaleX(1);
}

.favicon-preview {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.favicon-preview::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

.favicon-item:hover .favicon-preview::after {
    animation: shine 0.6s ease-in-out;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}

.favicon-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.favicon-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.favicon-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==========================================================================
   USAGE EXAMPLES
   ========================================================================== */

.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.usage-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.usage-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.usage-item h6 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Browser tab demo */
.browser-tab-demo,
.bookmark-demo {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.browser-tab-demo:hover,
.bookmark-demo:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.browser-tab-demo span,
.bookmark-demo span {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Mobile icon demo */
.mobile-icon-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    position: relative;
    overflow: hidden;
}

.mobile-icon-demo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></svg>');
    pointer-events: none;
}

.mobile-icon-demo span {
    font-size: 0.8rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.demo-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.demo-mobile-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   SUPPORTED FORMATS
   ========================================================================== */

.supported-formats {
    margin-top: 2rem;
    text-align: center;
}

.supported-formats h6 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.format-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.format-badges .badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.format-badges .badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.format-badges .badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    border-color: var(--primary-dark);
}

.format-badges .badge.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
    border-color: #059669;
}

.format-badges .badge.bg-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%) !important;
    border-color: #2563eb;
}

.format-badges .badge.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%) !important;
    border-color: #d97706;
}

.format-badges .badge.bg-secondary {
    background: linear-gradient(135deg, var(--text-secondary) 0%, #475569 100%) !important;
    border-color: #475569;
}

/* ==========================================================================
   GENERATION PROGRESS
   ========================================================================== */

/* Enhanced progress indicators */
.generation-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.generation-step.active {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-color);
}

.generation-step.completed {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success-color);
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.step-icon.pending {
    background: var(--border-color);
    color: var(--text-secondary);
}

.step-icon.active {
    background: var(--primary-color);
    color: white;
    animation: pulse 1.5s infinite;
}

.step-icon.completed {
    background: var(--success-color);
    color: white;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   DOWNLOAD SECTION ENHANCEMENTS
   ========================================================================== */

/* Enhanced download button */
#downloadBtn {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 1rem 2rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

#downloadBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#downloadBtn:hover::before {
    left: 100%;
}

#downloadBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Download stats */
.download-stats {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-align: center;
    font-weight: 600;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.download-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==========================================================================
   COLOR INPUT ENHANCEMENTS
   ========================================================================== */

/* Enhanced color input groups */
.color-input-group {
    background: var(--light-bg);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.color-input-group:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.color-input-group .form-control-color {
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.color-input-group .form-control-color:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .favicon-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .favicon-item {
        padding: 1rem;
    }
    
    .favicon-preview {
        width: 48px;
        height: 48px;
    }
    
    .usage-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .format-badges {
        justify-content: center;
    }
    
    .format-badges .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 576px) {
    .favicon-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .favicon-item {
        padding: 0.75rem;
    }
    
    .favicon-preview {
        width: 40px;
        height: 40px;
        margin-bottom: 0.75rem;
    }
    
    .favicon-label {
        font-size: 0.75rem;
    }
    
    .favicon-size {
        font-size: 0.7rem;
    }
    
    .usage-item {
        padding: 1rem;
    }
    
    .mobile-icon-demo {
        padding: 1rem;
    }
    
    .demo-mobile-icon {
        width: 48px;
        height: 48px;
    }
    
    .color-input-group {
        padding: 0.5rem;
    }
}

/* ==========================================================================
   MODAL ACCESSIBILITY FIXES
   ========================================================================== */

/* Ensure proper focus management for modals */
.modal {
    outline: none;
}

.modal[aria-hidden="true"] {
    display: none !important;
}

.modal[aria-hidden="false"] {
    display: block !important;
}

/* Progress Modal specific styles */
#progressModal {
    z-index: 1055; /* Ensure it's above other elements */
}

#progressModal .modal-content {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#progressModal .progress {
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

#progressModal .progress-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Spinner animation */
#progressModal .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.3em;
}

/* Ensure backdrop doesn't interfere with focus */
.modal-backdrop {
    z-index: 1050;
}

/* Force focus management */
.modal.show {
    display: block !important;
}

.modal.show[tabindex="-1"]:focus {
    outline: none;
}

/* ==========================================================================
   MODAL TRANSITIONS & ANIMATIONS
   ========================================================================== */

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Progress modal specific animation */
#progressModal.fade .modal-dialog {
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    transform: scale(0.9) translate(0, -20px);
    opacity: 0;
}

#progressModal.show .modal-dialog {
    transform: scale(1) translate(0, 0);
    opacity: 1;
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Screen reader only content */
.sr-only-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Ensure proper contrast for progress text */
#progressModal .text-muted {
    color: #6b7280 !important;
}

/* Better visibility for progress percentage */
#progressPercentage {
    font-weight: 600;
    color: #374151;
}

/* ==========================================================================
   CUSTOM MODAL CSS - Ersetzt Bootstrap Modal Styles
   ========================================================================== */

/* Custom modal implementation to avoid aria-hidden issues */
#progressModal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    outline: 0;
}

#progressModal.show {
    display: block !important;
}

#progressModal .modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

#progressModal .modal-dialog-centered {
    justify-content: center;
}

#progressModal .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    outline: 0;
}

#progressModal .modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.5rem;
}

/* Custom backdrop */
#custom-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

#custom-modal-backdrop.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

#custom-modal-backdrop.show {
    opacity: 1;
}

/* Progress bar styles */
#progressModal .progress {
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

#progressModal .progress-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
    height: 100%;
}

/* Spinner styles */
#progressModal .spinner-border {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    vertical-align: -0.125em;
    border: 0.3em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Text styles */
#progressModal h5 {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1f2937;
}

#progressModal .text-muted {
    color: #6b7280;
}

#progressModal small {
    font-weight: 600;
    color: #374151;
}

/* Responsive */
@media (min-width: 576px) {
    #progressModal .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }
}

/* Ensure proper z-index layering */
.modal-open {
    overflow: hidden !important;
}

/* Hide scrollbar compensation */
.modal-open {
    padding-right: 0 !important;
}

/* Fade animations for custom modal */
#progressModal {
    transition: opacity 0.15s linear;
}

#progressModal:not(.show) {
    opacity: 0;
}

#progressModal.show {
    opacity: 1;
}