/* ===================================
   GLOBAL STYLES & RESET
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* Neutral Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Dark Mode Colors */
    --dark-bg-primary: #0f172a;
    --dark-bg-secondary: #1e293b;
    --dark-bg-tertiary: #334155;
    --dark-border-color: #475569;
    --dark-text-primary: #f8fafc;
    --dark-text-secondary: #cbd5e1;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --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);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    font-size: 16px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===================================
   HEADER STYLES
   =================================== */

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: var(--spacing-xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::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"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;
}

.logo-icon {
    font-size: 3rem;
    margin-right: var(--spacing-sm);
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

/* ===================================
   NAVIGATION TABS
   =================================== */

.nav-tabs {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-container {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: var(--spacing-xs);
    padding: var(--spacing-md) 0;
}

.tab-container::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 44px;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.tab-icon {
    font-size: 1.2rem;
}

/* ===================================
   MAIN CONTENT & TOOL SECTIONS
   =================================== */

.main-content {
    padding: var(--spacing-2xl) 0;
    min-height: calc(100vh - 200px);
}

.tool-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tool-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.tool-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.tool-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===================================
   UPLOAD AREA STYLES
   =================================== */

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    text-align: center;
    background: var(--bg-primary);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    transform: scale(1.02);
}

.upload-content {
    position: relative;
    z-index: 2;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.7;
}

.upload-area h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}

/* ===================================
   TOOL CONTROLS & PANELS
   =================================== */

.tool-controls {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
}

.preview-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.image-preview {
    text-align: center;
}

.image-preview.large {
    grid-column: 1 / -1;
}

.image-preview h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.image-info {
    margin-top: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.control-panel {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.control-group {
    margin-bottom: var(--spacing-lg);
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    font-style: italic;
}

/* ===================================
   FORM CONTROLS
   =================================== */

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

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

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

.size-input-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.size-input-group input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: border-color var(--transition-fast);
}

.size-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.size-input-group select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
    justify-content: center;
}

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

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

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

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.button-group {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
}

/* ===================================
   IMAGE CROPPER SPECIFIC STYLES
   =================================== */

.crop-instructions {
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: center;
}

.instruction-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    max-width: 500px;
    text-align: left;
}

.instruction-card h4 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
    font-weight: 600;
}

.instruction-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instruction-card li {
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.instruction-card li:last-child {
    margin-bottom: 0;
}

.instruction-card strong {
    color: var(--text-primary);
}

.cropper-container {
    margin-bottom: var(--spacing-xl);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.crop-area {
    position: relative;
    display: inline-block;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.crop-area img {
    display: block;
    max-width: 100%;
    height: auto;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: crosshair;
    z-index: 1;
}

.crop-selection {
    position: absolute;
    border: 2px solid var(--primary-color);
    background: transparent;
    cursor: move;
    z-index: 2;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.crop-selection::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 2px;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.crop-handle:hover {
    background: var(--primary-dark);
    transform: scale(1.2);
}

.crop-handle.tl { 
    top: -6px; 
    left: -6px; 
    cursor: nw-resize; 
}

.crop-handle.tr { 
    top: -6px; 
    right: -6px; 
    cursor: ne-resize; 
}

.crop-handle.bl { 
    bottom: -6px; 
    left: -6px; 
    cursor: sw-resize; 
}

.crop-handle.br { 
    bottom: -6px; 
    right: -6px; 
    cursor: se-resize; 
}

.crop-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.crop-info span {
    font-weight: 600;
    color: var(--primary-color);
}

.preview-result {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

#cropped-canvas {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* ===================================
   BASE64 CONVERTER STYLES
   =================================== */

#base64-output {
    width: 100%;
    height: 150px;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

#base64-output:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ===================================
   FAVICON GENERATOR STYLES
   =================================== */

.favicon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.favicon-item {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all var(--transition-fast);
}

.favicon-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.favicon-item img {
    display: block;
    margin: 0 auto var(--spacing-md);
    border-radius: var(--radius-sm);
    background: white;
    padding: var(--spacing-xs);
    box-shadow: var(--shadow-sm);
}

.favicon-item h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.favicon-item .btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
}

.download-options {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-top: var(--spacing-lg);
}

.download-options .btn {
    flex: 1;
    max-width: 250px;
}

/* ===================================
   FILTERS PANEL STYLES
   =================================== */

.filters-panel {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.filter-group {
    margin-bottom: var(--spacing-xl);
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.filter-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.filter-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

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

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

.slider-controls {
    display: grid;
    gap: var(--spacing-md);
}

/* ===================================
   COLOR PICKER STYLES
   =================================== */

.colorpicker-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--spacing-xl);
    align-items: start;
}

.image-container {
    position: relative;
    display: inline-block;
}

#colorpicker-canvas {
    max-width: 100%;
    cursor: crosshair;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.color-magnifier {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    display: none;
    overflow: hidden;
    z-index: 10;
}

#magnifier-canvas {
    width: 100%;
    height: 100%;
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

.color-info-panel {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 120px;
}

.color-info-panel h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.color-preview {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(45deg, #ccc 25%, transparent 25%), 
                linear-gradient(-45deg, #ccc 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #ccc 75%), 
                linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.color-values {
    display: grid;
    gap: var(--spacing-md);
}

.color-value {
    display: grid;
    gap: var(--spacing-sm);
}

.color-value label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.value-group {
    display: flex;
    gap: var(--spacing-sm);
}

.value-group input {
    flex: 1;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    background: var(--bg-primary);
}

.copy-btn {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.8rem;
}

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

.color-history {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.color-history h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.history-colors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
    gap: var(--spacing-sm);
}

.history-color {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-color:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* ===================================
   MEDIA PLAYER STYLES
   =================================== */

.media-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.media-element {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.media-element video,
.media-element audio {
    width: 100%;
    height: auto;
    display: block;
}

.media-element audio {
    height: 100px;
}

.custom-controls {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.progress-container {
    margin-bottom: var(--spacing-md);
}

.progress-bar {
    position: relative;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width var(--transition-fast);
    width: 0%;
}

.progress-handle {
    position: absolute;
    top: -7px;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    left: 0%;
    transform: translateX(-50%);
    transition: left var(--transition-fast);
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.control-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.control-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.time-display {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.volume-slider {
    width: 80px;
}

/* ===================================
   LOADING SPINNER
   =================================== */

.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.loading-spinner.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

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

.loading-spinner p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===================================
   FOOTER
   =================================== */

.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xl) 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
}

.support-link {
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    text-align: center;
    min-width: 150px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.github-link {
    background: #24292e;
    color: white;
    border: 1px solid #444;
}

.github-link:hover {
    background: #333;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.coffee-link {
    background: linear-gradient(135deg, #FFDD00, #FBB124);
    color: #4B3818;
    border: none;
}

.coffee-link:hover {
    background: linear-gradient(135deg, #FFCB00, #FF9900);
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 187, 36, 0.3);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1024px) {
    .colorpicker-container {
        grid-template-columns: 1fr;
    }
    
    .color-info-panel {
        position: static;
    }
    
    .preview-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .tool-header h2 {
        font-size: 2rem;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .tab-container {
        padding: var(--spacing-sm) 0;
    }
    
    .tab-btn {
        padding: var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    .tab-icon {
        font-size: 1rem;
    }
    
    .tool-controls {
        padding: var(--spacing-md);
    }
    
    .control-panel {
        padding: var(--spacing-md);
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn {
        width: 100%;
        justify-content: center;
    }
    
    .controls-row {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .favicon-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .filter-buttons {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: var(--spacing-lg);
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .upload-area h3 {
        font-size: 1.2rem;
    }
    
    .preview-section {
        gap: var(--spacing-md);
    }
    
    .image-preview img {
        max-height: 200px;
    }
    
    .size-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .value-group {
        flex-direction: column;
    }
    
    .main-content {
        padding: var(--spacing-lg) 0;
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */

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

/* Focus states for keyboard navigation */
.tab-btn:focus,
.btn:focus,
.file-input:focus + .upload-content,
.slider:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #000;
        --bg-secondary: #fff;
        --bg-tertiary: #f0f0f0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: var(--dark-bg-primary);
        --bg-secondary: var(--dark-bg-secondary);
        --bg-tertiary: var(--dark-bg-tertiary);
        --border-color: var(--dark-border-color);
        --text-primary: var(--dark-text-primary);
        --text-secondary: var(--dark-text-secondary);
    }
    
    .upload-area {
        background: var(--dark-bg-secondary);
    }
    
    .media-element {
        background: #1a1a1a;
    }
}

/* Print styles */
@media print {
    .nav-tabs,
    .upload-area,
    .custom-controls,
    .footer {
        display: none;
    }
    
    .tool-section.active {
        display: block !important;
    }
    
    .preview-section {
        break-inside: avoid;
    }
}
