/* Custom CSS for Smart Web Tools Favicon Generator */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #0f172a;
        --surface-color: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #334155;
    }
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Enhanced button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--background-color);
    transform: translateY(-1px);
}

/* Enhanced card styles */
.card {
    background-color: var(--surface-color);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--background-color);
}

/* Enhanced form controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--surface-color);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

/* Enhanced range slider */
.form-range {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Enhanced color picker */
.form-color {
    width: 100%;
    height: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-color:hover {
    border-color: var(--primary-color);
}

/* Upload area enhancement */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.5);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.upload-text {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Canvas container */
.canvas-container {
    position: relative;
    background-color: var(--background-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1rem;
    background-image: 
        repeating-conic-gradient(#f0f0f0 0% 25%, transparent 0% 50%);
    background-size: 20px 20px;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 auto;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: white;
    box-shadow: var(--shadow-md);
}

/* Preview cards */
.preview-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

.preview-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.preview-canvas {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin: 0.5rem auto;
}

/* Tab navigation */
.tab-nav {
    display: flex;
    background-color: var(--background-color);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.tab-button {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.5);
}

.tab-button.active {
    color: white;
    background-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Icon grid */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.icon-button {
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--surface-color);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.icon-button.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

/* Style presets */
.style-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.style-preset {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--surface-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.style-preset:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.style-preset.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

/* Canvas controls */
.canvas-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.canvas-control {
    width: 2rem;
    height: 2rem;
    border: none;
    background-color: var(--surface-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-control:hover {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

/* Export buttons */
.export-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.export-button {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.export-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.export-button.ico {
    background-color: #3b82f6;
    color: white;
}

.export-button.png {
    background-color: #10b981;
    color: white;
}

.export-button.zip {
    background-color: #8b5cf6;
    color: white;
}

.export-button.copy {
    background-color: #6b7280;
    color: white;
}

/* Code block */
.code-block {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
}

/* Responsive design */
@media (max-width: 1024px) {
    .grid-cols-12 {
        grid-template-columns: 1fr;
    }
    
    .lg\:col-span-3,
    .lg\:col-span-6,
    .lg\:col-span-3 {
        grid-column: span 1;
    }
    
    .canvas-container {
        padding: 1rem;
    }
    
    .canvas-controls {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: 1rem;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .icon-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .style-presets {
        grid-template-columns: 1fr;
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .tab-button {
        min-width: 120px;
    }
    
    .export-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .export-button {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 640px) {
    .upload-area {
        padding: 1.5rem;
    }
    
    .canvas-container {
        padding: 0.5rem;
    }
    
    .icon-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .export-button {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error states */
.success {
    border-color: var(--success-color) !important;
    background-color: rgba(5, 150, 105, 0.1) !important;
}

.error {
    border-color: var(--error-color) !important;
    background-color: rgba(220, 38, 38, 0.1) !important;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-primary);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

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

/* Focus styles */
.focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Browser preview sections */
.browser-tab-preview {
    background: linear-gradient(to right, #f3f4f6 0%, #f3f4f6 95%, #e5e7eb 95%, #e5e7eb 100%);
    border: 1px solid #d1d5db;
    border-radius: 8px 8px 0 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.browser-tab-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

.browser-tab-preview::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5%;
    height: 100%;
    background: #e5e7eb;
    border-radius: 0 8px 0 0;
}

.browser-tab-preview::after {
    content: 'Click to see details';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.browser-tab-preview:hover::after {
    bottom: -25px;
    opacity: 1;
}

.bookmarks-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow-x: auto;
}

.bookmarks-preview::-webkit-scrollbar {
    height: 4px;
}

.bookmarks-preview::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.bookmarks-preview::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.mobile-browser-preview {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border: 2px solid #4b5563;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.mobile-browser-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: #6b7280;
    border-radius: 0 0 4px 4px;
}

.dark-theme-preview {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.dark-theme-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6, #ec4899);
}

/* Browser preview animations */
.browser-tab-preview,
.bookmarks-preview,
.mobile-browser-preview,
.dark-theme-preview {
    transition: all 0.3s ease;
}

.browser-tab-preview:hover,
.bookmarks-preview:hover,
.mobile-browser-preview:hover,
.dark-theme-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Browser preview icons */
.browser-preview-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.browser-preview-icon.mobile {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

/* Responsive browser previews */
@media (max-width: 768px) {
    .browser-tab-preview,
    .dark-theme-preview {
        padding: 0.75rem;
    }
    
    .mobile-browser-preview {
        padding: 0.75rem;
    }
    
    .bookmarks-preview {
        padding: 0.75rem;
    }
    
    .browser-preview-icon {
        width: 14px;
        height: 14px;
    }
    
    .browser-preview-icon.mobile {
        width: 28px;
        height: 28px;
    }
}
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
    
    .card {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}