/* Multi-Tools Website - Custom CSS */

/* Root Variables */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8f9fa;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 60px 0;
    margin: -24px -12px 0 -12px;
    border-radius: 0 0 20px 20px;
}

.hero-section h1 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-section .lead {
    color: white !important;
    opacity: 1;
}


/* Search Container */
.search-container .form-control {
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.search-container .btn {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: var(--box-shadow);
}

/* Category Filters */
.category-filters .btn {
    transition: var(--transition);
    border-radius: 25px;
    font-weight: 500;
}

.category-filters .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

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

/* Tool Cards */
.tool-card {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tool-icon.category-image { color: #007bff; }
.tool-icon.category-text { color: #28a745; }
.tool-icon.category-seo { color: #ffc107; }
.tool-icon.category-social { color: #17a2b8; }
.tool-icon.category-pdf { color: #dc3545; }
.tool-icon.category-file { color: #6c757d; }
.tool-icon.category-ai { color: #dc3545; }
.tool-icon.category-calculator { color: #343a40; }
.tool-icon.category-developer { color: #6f42c1; }
.tool-icon.category-trending { color: #ff6b35; }
.tool-icon.category-misc { color: #fd7e14; }

.tool-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 280px;
}

.tool-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
    padding-top: 0.5rem;
}

.tool-actions {
    margin-top: auto;
    text-align: center;
    padding-top: 1rem;
    flex-shrink: 0;
}

.tool-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
    margin-top: 1rem;
}

.tool-card .card-text {
    color: var(--secondary-color);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.tool-card .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 20px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    min-width: 120px;
}

.tool-card .btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

/* Favorite Button */
.favorite-btn {
    border: none !important;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.favorite-btn:hover {
    background-color: #dc3545 !important;
    color: white !important;
    transform: scale(1.1);
}

.favorite-btn i {
    transition: all 0.2s ease;
}

/* Category Badges */
.badge {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Favorites Button */
#favoritesBtn {
    position: relative;
}

#favoritesBtn.active {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
}

#favoritesCount {
    font-weight: bold;
}

/* Category Icons */
.category-image { color: #e74c3c; }
.category-seo { color: #3498db; }
.category-text { color: #2ecc71; }
.category-developer { color: #9b59b6; }
.category-calculator { color: #f39c12; }
.category-converter { color: #1abc9c; }
.category-security { color: #e67e22; }
.category-social { color: #e91e63; }
.category-misc { color: #34495e; }

/* Ad Spaces */
.ad-space {
    margin: 2rem 0;
}

.ad-placeholder {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    background-color: #f8f9fa;
}

/* Sidebar */
.card {
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.list-group-item-action:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
    transition: var(--transition);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2c3e50, #34495e) !important;
}

footer .social-links a {
    transition: var(--transition);
}

footer .social-links a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .tool-card .card-body {
        min-height: 260px;
    }
}

@media (max-width: 992px) {
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .category-filters .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    .tool-card .card-body {
        min-height: 240px;
        padding: 1.25rem;
    }
    
    .tool-icon {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0;
        margin: -24px 0 0 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .category-filters {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .category-filters .btn {
        margin: 0.25rem;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        border-radius: 20px;
    }
    
    .tool-card {
        margin-bottom: 1.5rem;
    }
    
    .tool-card .card-body {
        min-height: 220px;
        padding: 1rem;
    }
    
    .tool-icon {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .tool-card .card-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .tool-card .card-text {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .tool-card .btn-primary {
        font-size: 0.9rem;
        padding: 0.4rem 1.2rem;
        min-width: 100px;
    }
    
    /* Sidebar adjustments */
    .col-lg-3 {
        margin-top: 2rem;
    }
    
    /* Search bar mobile */
    .search-container .input-group {
        flex-direction: column;
    }
    
    .search-container .form-control {
        border-radius: var(--border-radius);
        margin-bottom: 0.5rem;
    }
    
    .search-container .btn {
        border-radius: var(--border-radius);
        width: 100%;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .hero-section .lead {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .search-container {
        padding: 0 1rem;
    }
    
    .category-filters .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        margin: 0.2rem;
        display: inline-block;
        width: auto;
    }
    
    .tool-card .card-body {
        min-height: 200px;
        padding: 0.75rem;
    }
    
    .tool-icon {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .tool-card .card-title {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
        margin-top: 0.5rem;
    }
    
    .tool-card .card-text {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
    
    .tool-card .btn-primary {
        font-size: 0.85rem;
        padding: 0.35rem 1rem;
        min-width: 90px;
    }
    
    /* Grid adjustments for mobile */
    .row.g-3 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
    
    /* Popular tools sidebar */
    .card .list-group-item {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Footer adjustments */
    footer .row > div {
        margin-bottom: 1.5rem;
    }
    
    footer .social-links a {
        margin-right: 1rem !important;
        font-size: 1.2rem;
    }
}

@media (max-width: 400px) {
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .category-filters .btn {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .tool-card .card-body {
        min-height: 180px;
        padding: 0.5rem;
    }
    
    .tool-icon {
        font-size: 1.6rem;
    }
    
    .tool-card .card-title {
        font-size: 0.9rem;
    }
    
    .tool-card .card-text {
        font-size: 0.75rem;
    }
    
    .tool-card .btn-primary {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
        min-width: 80px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(13, 110, 253, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Utility Classes */
.text-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: var(--transition);
}

.shadow-hover:hover {
    box-shadow: var(--box-shadow);
}

/* Tool Page Specific Styles */
.tool-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin: 2rem 0;
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.tool-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tool-input-group {
    margin-bottom: 1.5rem;
}

.tool-input-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.tool-result {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
}

.tool-result.success {
    background-color: #d1edff;
    border-color: var(--info-color);
}

.tool-result.error {
    background-color: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* ========================================
   TOOL-SPECIFIC STANDARDIZED STYLES
   ======================================== */

/* File Upload & Drop Zones */
.file-drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background-color: #f8f9fa;
}

.file-drop-zone:hover {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
}

.file-drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.file-drop-zone i {
    color: var(--secondary-color);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.file-drop-zone:hover i {
    color: var(--primary-color);
}

/* File Input Styling */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-block;
}

.file-input-label:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Progress Bars */
.progress-container {
    margin: 1rem 0;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

/* Tool Results */
.tool-result {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.tool-result.success {
    background-color: #d1edff;
    border-color: var(--info-color);
    color: #0c5460;
}

.tool-result.error {
    background-color: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.tool-result.warning {
    background-color: #fff3cd;
    border-color: var(--warning-color);
    color: #856404;
}

/* Preview Containers */
.preview-container {
    border: 2px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1rem 0;
    background: white;
    max-height: 400px;
    overflow-y: auto;
}

.page-preview, .image-preview {
    border: 2px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    margin: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    display: inline-block;
}

.page-preview:hover, .image-preview:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.page-preview.selected, .image-preview.selected {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
}

/* Form Controls */
.tool-input-group {
    margin-bottom: 1.5rem;
}

.tool-input-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    display: block;
}

.tool-input-group .form-control,
.tool-input-group .form-select {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    transition: var(--transition);
}

.tool-input-group .form-control:focus,
.tool-input-group .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Buttons */
.btn-tool-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
}

.btn-tool-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.btn-tool-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
}

.btn-tool-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
    transform: translateY(-2px);
}

/* Validation Styles */
.validation-result {
    transition: var(--transition);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.validation-valid {
    background-color: #d1edff;
    border: 1px solid var(--info-color);
    color: #0c5460;
}

.validation-invalid {
    background-color: #f8d7da;
    border: 1px solid var(--danger-color);
    color: #721c24;
}

/* Card Type Icons */
.card-type-icon {
    width: 40px;
    height: 25px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 0.5rem;
}

/* Special Input Types */
.card-input {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.code-input {
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
}

/* Output Areas */
.output-area {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* Statistics Display */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.stat-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--box-shadow);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Color Picker Styles */
.color-preview {
    width: 50px;
    height: 50px;
    border: 2px solid #dee2e6;
    border-radius: var(--border-radius);
    display: inline-block;
    margin: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Range Sliders */
.range-container {
    margin: 1rem 0;
}

.range-container input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

/* Page Number Overlay */
.page-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.range-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
}

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

/* Enhanced Tool-Specific Responsive Design */
@media (max-width: 1200px) {
    .tool-container {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
}

@media (max-width: 992px) {
    .tool-header h1 {
        font-size: 2.5rem;
    }
    
    .tool-icon {
        font-size: 3rem;
    }
    
    .file-drop-zone {
        padding: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .tool-header {
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
    }
    
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .tool-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .file-drop-zone {
        padding: 1.5rem;
    }
    
    .file-drop-zone i {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .btn-tool-primary,
    .btn-tool-secondary {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .tool-input-group {
        margin-bottom: 1rem;
    }
    
    .tool-result {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .preview-container {
        max-height: 300px;
        padding: 0.75rem;
    }
    
    .page-preview, .image-preview {
        margin: 0.25rem;
        padding: 0.5rem;
    }
    
    .output-area {
        padding: 0.75rem;
        max-height: 300px;
        font-size: 0.9rem;
    }
    
    .color-preview {
        width: 40px;
        height: 40px;
        margin: 0.25rem;
    }
    
    /* Voice tools specific */
    .voice-option {
        margin-bottom: 0.75rem;
    }
    
    .voice-avatar {
        width: 50px;
        height: 50px;
    }
    
    .sample-text-card, .template-card {
        margin-bottom: 1rem;
    }
    
    .audio-player-container {
        padding: 1rem;
    }
    
    .player-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .progress {
        min-width: 200px;
        flex-grow: 1;
    }
    
    /* Unit converter specific */
    .conversion-type {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .form-range {
        margin-bottom: 0.5rem;
    }
    
    .history-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .tool-container {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }
    
    .tool-header h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .tool-icon {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .file-drop-zone {
        padding: 1rem;
    }
    
    .file-drop-zone i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .btn-tool-primary,
    .btn-tool-secondary {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .tool-input-group label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .tool-input-group .form-control,
    .tool-input-group .form-select {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .output-area {
        padding: 0.5rem;
        max-height: 250px;
        font-size: 0.8rem;
    }
    
    .color-preview {
        width: 35px;
        height: 35px;
        margin: 0.2rem;
    }
    
    /* Voice tools mobile optimization */
    .voice-option .card-body {
        padding: 0.75rem;
    }
    
    .voice-avatar {
        width: 40px;
        height: 40px;
    }
    
    .voice-option h6 {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .voice-option small {
        font-size: 0.75rem;
    }
    
    .player-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .player-controls .btn {
        margin-bottom: 0.5rem;
    }
    
    .progress {
        margin: 0.5rem 0;
        min-width: auto;
    }
    
    .time-display {
        text-align: center;
        font-size: 0.9rem;
    }
    
    /* Unit converter mobile */
    .conversion-type {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    .form-range {
        height: 6px;
    }
    
    .form-range::-webkit-slider-thumb {
        width: 18px;
        height: 18px;
    }
    
    .history-item {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Feature cards mobile */
    .feature-card {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .feature-card i {
        font-size: 1.5rem;
    }
    
    .feature-card h6 {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .feature-card p {
        font-size: 0.8rem;
        margin-bottom: 0;
    }
}

@media (max-width: 400px) {
    .tool-container {
        padding: 0.5rem;
        margin: 0.5rem 0;
    }
    
    .tool-header h1 {
        font-size: 1.5rem;
    }
    
    .tool-icon {
        font-size: 1.75rem;
    }
    
    .file-drop-zone {
        padding: 0.75rem;
    }
    
    .btn-tool-primary,
    .btn-tool-secondary {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .voice-option .card-body {
        padding: 0.5rem;
    }
    
    .voice-avatar {
        width: 35px;
        height: 35px;
    }
    
    .conversion-type {
        font-size: 0.75rem;
        padding: 0.3rem;
    }
    
    .feature-card {
        padding: 0.5rem;
    }
    
    .feature-card i {
        font-size: 1.25rem;
    }
}
