/**
 * Perfect Tools - Professional Upgrade v7.5
 * 
 * CRITICAL: This stylesheet only improves UI/UX
 * All tool functionality remains 100% unchanged
 * 
 * Features:
 * - 6 tools per row on desktop
 * - Premium footer
 * - Enhanced animations
 * - Better responsiveness
 * - Professional typography
 */

/* ============================================
   1. LAYOUT SYSTEM - 6 TOOLS PER ROW
   ============================================ */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    margin-top: 30px;
}

/* Responsive breakpoints */
@media (max-width: 1600px) {
    .tools-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1400px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ============================================
   2. TOOL CARDS - EQUAL HEIGHT & HOVER
   ============================================ */

.tool-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e5e5e7;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border-color: #667eea;
}

.tool-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
}

.tool-name {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    line-height: 1.3;
}

.tool-description {
    font-size: 14px;
    color: #6e6e73;
    line-height: 1.6;
    flex-grow: 1;
}

.tool-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #f5f5f7;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #6e6e73;
    text-transform: uppercase;
    margin-top: auto;
    align-self: flex-start;
}

.tool-badge.new {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.tool-badge.popular {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
}

/* ============================================
   3. PREMIUM FOOTER
   ============================================ */

.premium-footer {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    margin-top: 80px;
    padding: 60px 0 0 0;
}

.footer-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 40px 40px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
    gap: 40px;
}

@media (max-width: 1200px) {
    .footer-main {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .footer-main {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.footer-section p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-block;
}

.footer-link:hover {
    color: white;
    transform: translateX(5px);
}

.footer-link::before {
    content: '→ ';
    opacity: 0;
    margin-right: 5px;
    transition: opacity 0.2s;
}

.footer-link:hover::before {
    opacity: 1;
}

.social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s;
}

.social-link:hover {
    background: white;
    color: #1e3c72;
    transform: translateY(-3px);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.contact-item i {
    font-size: 16px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 40px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

@media (max-width: 768px) {
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
}

.footer-legal {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: white;
}

/* ============================================
   4. IMPROVED STICKY HEADER
   ============================================ */

.top-nav {
    background: white;
    border-bottom: 1px solid #e5e5e7;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.top-nav.scrolled {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s;
}

.logo-section:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================
   5. ENHANCED TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: #1d1d1f;
}

h1 {
    font-size: 48px;
    margin-bottom: 16px;
}

h2 {
    font-size: 36px;
    margin-bottom: 16px;
}

h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

p {
    line-height: 1.6;
    color: #6e6e73;
}

@media (max-width: 768px) {
    h1 {
        font-size: 32px;
    }
    
    h2 {
        font-size: 28px;
    }
    
    h3 {
        font-size: 20px;
    }
}

/* ============================================
   6. SEARCH BAR ENHANCEMENT
   ============================================ */

.search-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 40px;
    border: 1px solid #e5e5e7;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 60px 16px 24px;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    background: #f5f5f7;
}

.search-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #6e6e73;
    pointer-events: none;
}

/* ============================================
   7. CATEGORY HEADERS
   ============================================ */

.category-header {
    margin: 60px 0 30px 0;
    padding-bottom: 16px;
    border-bottom: 3px solid #e5e5e7;
    position: relative;
}

.category-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.category-title {
    font-size: 32px;
    font-weight: 700;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 16px;
}

.category-title span:first-child {
    font-size: 36px;
}

.category-count {
    font-size: 16px;
    color: #6e6e73;
    font-weight: 500;
    background: #f5f5f7;
    padding: 6px 14px;
    border-radius: 20px;
}

/* ============================================
   8. STATS SECTION
   ============================================ */

.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   9. BREADCRUMBS
   ============================================ */

.breadcrumbs {
    padding: 16px 40px;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-item {
    color: #6e6e73;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: #667eea;
}

.breadcrumb-separator {
    color: #d2d2d7;
}

.breadcrumb-current {
    color: #1d1d1f;
    font-weight: 500;
}

/* ============================================
   10. BACK BUTTON ENHANCEMENT
   ============================================ */

.back-to-dashboard {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 2px solid #667eea;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.back-to-dashboard:hover {
    background: #667eea;
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ============================================
   11. ANIMATIONS & TRANSITIONS
   ============================================ */

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* Stagger animations for tool cards */
.tool-card {
    animation: fadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.2s; }
.tool-card:nth-child(5) { animation-delay: 0.25s; }
.tool-card:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   12. LOADING STATES
   ============================================ */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================
   13. ACCESSIBILITY IMPROVEMENTS
   ============================================ */

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

:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ============================================
   14. PRINT STYLES
   ============================================ */

@media print {
    .top-nav,
    .filter-tabs,
    .stats-section,
    .search-section,
    .premium-footer {
        display: none;
    }
    
    .tool-card {
        page-break-inside: avoid;
    }
}

/* ============================================
   15. PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU acceleration for animations */
.tool-card,
.social-link,
.back-to-dashboard {
    will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ============================================
   TOOL PAGE IMPROVEMENTS
   ============================================ */

.tool-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.tool-interface {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

/* Input & Output Sections */
.input-section,
.output-section {
    margin-bottom: 25px;
}

.input-section label,
.output-section label {
    display: block;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
    font-size: 15px;
}

/* Textarea Styles */
.tall-textarea {
    height: 150px !important;
    min-height: 150px;
}

.medium-textarea {
    height: 100px !important;
    min-height: 100px;
}

.output-textarea {
    height: 120px !important;
    background: #f8f9fa !important;
    min-height: 120px;
}

textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.3s ease;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea[readonly] {
    background: #f8f9fa;
    color: #4b5563;
    cursor: not-allowed;
}

/* Select Dropdown */
select {
    padding: 10px 15px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
    min-width: 150px;
}

select:focus {
    outline: none;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Input Fields */
input[type="text"],
input[type="number"],
input[type="color"],
input[type="range"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="file"] {
    padding: 10px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    width: 100%;
}

input[type="file"]:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

/* Copy Button */
.btn-copy {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-copy:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Tool Content Sections */
.tool-content {
    margin-top: 50px;
}

.tool-content h2 {
    color: #1f2937;
    font-size: 24px;
    margin-top: 40px;
    margin-bottom: 15px;
    font-weight: 700;
}

.tool-content p {
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 15px;
}

.tool-content ol,
.tool-content ul {
    color: #4b5563;
    line-height: 1.8;
    margin-left: 25px;
    margin-bottom: 20px;
}

.tool-content li {
    margin-bottom: 10px;
}

/* FAQ Section */
.faq-section {
    margin-top: 40px;
}

.faq-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.faq-item h3 {
    color: #1f2937;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 600;
}

.faq-item p {
    color: #6b7280;
    line-height: 1.6;
}

/* Color Preview */
.color-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Result Display */
.result-display {
    background: #f0f4ff;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-interface {
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
    }
    
    .tool-page {
        padding: 20px 15px;
    }
}

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

.professional-footer {
    background: #1f2937;
    color: #e5e7eb;
    padding: 60px 20px 20px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column {
    min-width: 0;
}

.footer-heading {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-text {
    color: #9ca3af;
    line-height: 1.7;
    margin-bottom: 15px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #667eea;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    font-size: 1.5rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.social-link:hover {
    transform: scale(1.2);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 30px;
    border-top: 1px solid #374151;
    text-align: center;
    color: #9ca3af;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}



/* Homepage UI Improvements v8.2 */
.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15) !important;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5) !important;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    transform: translateY(-3px);
}

/* Improved category cards */
.category-card {
    transition: all 0.3s ease;
}

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

