/* JSON Tools - Shared Stylesheet */

/* Ensure ads don't break layout */
.adsbygoogle {
    max-width: 100%;
}

/* Navbar styling */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.nav-link {
    transition: all 0.2s ease-in-out;
}

.nav-link:hover {
    color: #2563eb;
    transform: translateY(-1px);
}

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

/* Optimized Card Classes */
.card-base {
    padding: 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.2s ease-in-out;
    transform: translateY(0);
    border-width: 1px;
}

.card-base:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-blue {
    border-color: #dbeafe;
}

.card-blue:hover {
    border-color: #bfdbfe;
}

.card-green {
    border-color: #dcfce7;
}

.card-green:hover {
    border-color: #bbf7d0;
}

.card-purple {
    border-color: #f3e8ff;
}

.card-purple:hover {
    border-color: #e9d5ff;
}

.card-orange {
    border-color: #fed7aa;
}

.card-orange:hover {
    border-color: #fdba74;
}

.card-indigo {
    border-color: #e0e7ff;
}

.card-indigo:hover {
    border-color: #c7d2fe;
}

.card-teal {
    border-color: #ccfbf1;
}

.card-teal:hover {
    border-color: #99f6e4;
}

/* Icon Container Classes */
.icon-base {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: background-color 0.2s ease-in-out;
}

.icon-blue {
    background-color: #dbeafe;
}

.group:hover .icon-blue {
    background-color: #bfdbfe;
}

.icon-green {
    background-color: #dcfce7;
}

.group:hover .icon-green {
    background-color: #bbf7d0;
}

.icon-purple {
    background-color: #f3e8ff;
}

.group:hover .icon-purple {
    background-color: #e9d5ff;
}

.icon-orange {
    background-color: #fed7aa;
}

.group:hover .icon-orange {
    background-color: #fdba74;
}

.icon-indigo {
    background-color: #e0e7ff;
}

.group:hover .icon-indigo {
    background-color: #c7d2fe;
}

.icon-teal {
    background-color: #ccfbf1;
}

.group:hover .icon-teal {
    background-color: #99f6e4;
}

/* JSON Input Areas */
.json-input {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.4;
    tab-size: 2;
}

.json-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* JSON Validation States */
.json-error {
    border-color: #ef4444 !important;
}

.json-valid {
    border-color: #10b981 !important;
}

/* Difference highlighting */
.diff-added {
    background-color: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
    padding-left: 8px;
}

.diff-removed {
    background-color: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #ef4444;
    padding-left: 8px;
}

.diff-modified {
    background-color: #fef3c7;
    color: #d97706;
    border-left: 4px solid #f59e0b;
    padding-left: 8px;
}

.diff-line {
    padding: 1px 4px;
    margin: 0;
    border-radius: 3px;
}

.diff-context {
    background-color: transparent;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .card-base {
        padding: 1rem;
    }
    
    .icon-base {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Loading animations */
.loading-spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Button hover effects */
.btn-primary {
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    background: linear-gradient(to right, #2563eb, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Ad container styling */
.ad-container {
    min-height: 90px;
    max-height: 120px; /* Prevent excessive height */
    min-width: 300px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
    background-color: transparent;
    border-radius: 8px;
}

/* AdSense specific styling */
.adsbygoogle {
    display: block !important;
    min-height: 90px;
    max-height: 120px; /* Constrain banner ads */
    min-width: 300px;
    width: 100%;
    background-color: transparent !important;
    border: none !important;
}

/* Fixed size ads (leaderboard banner) */
.adsbygoogle.fixed-ad[data-ad-format="leaderboard"] {
    width: 728px !important;
    height: 90px !important;
    max-height: 90px !important;
    max-width: 728px !important;
}

/* Responsive ads - controlled by container size */
.adsbygoogle.responsive-ad {
    width: 100% !important;
    min-height: 90px;
    max-height: 280px; /* Allow for larger responsive ads */
    max-width: 100%;
}

/* Container control for responsive ads */
.ad-container:has(.responsive-ad) {
    min-height: 90px;
    max-height: 300px; /* Control responsive ad height here */
    max-width: 728px;   /* Control responsive ad width here */
}

/* Prevent black spaces in ad containers */
.adsbygoogle:empty {
    background-color: #f9fafb;
    border: 1px dashed #d1d5db;
    position: relative;
}

.adsbygoogle:empty::after {
    content: "Ad Loading...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #9ca3af;
    font-size: 14px;
    font-family: system-ui, -apple-system, sans-serif;
}

.ad-placeholder {
    background-color: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-weight: 500;
    min-height: 90px;
    width: 100%;
    max-width: 728px;
}

@media (max-width: 768px) {
    .desktop-ad {
        display: none;
    }
    .ad-container {
        min-height: 50px;
        max-height: 60px; /* Mobile banner height */
        min-width: 280px;
    }
    
    .adsbygoogle {
        min-height: 50px;
        max-height: 60px;
        min-width: 280px;
    }
    
    /* Mobile fixed size ads */
    .adsbygoogle.fixed-ad[data-ad-format="leaderboard"] {
        width: 320px !important;
        height: 50px !important;
        max-height: 50px !important;
        max-width: 320px !important;
    }
    
    /* Mobile responsive ads */
    .adsbygoogle.responsive-ad {
        min-height: 50px;
        max-height: 100px; /* Smaller on mobile */
    }
    
    .ad-container:has(.responsive-ad) {
        max-height: 120px; /* Mobile responsive container */
        max-width: 320px;
    }
}

@media (min-width: 769px) {
    .mobile-ad {
        display: none;
    }
}

/* Tool-specific overrides can be added here */