/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
    line-height: 1.6;
}

.cleaner-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.title-icon {
    font-size: 2rem;
    margin-right: 10px;
}

.title-sub {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: #94a3b8;
    margin-top: 5px;
    text-shadow: none;
}

.description {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
}

/* Ads */
.ad-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-ad {
    margin-top: 30px;
}

/* Layout */
.layout {
    display: grid;
    grid-template-columns: 1fr 350px 1fr;
    gap: 24px;
    align-items: stretch;
}

@media (max-width: 1400px) {
    .layout {
        grid-template-columns: 1fr 320px;
        grid-template-rows: auto auto;
    }
    
    .actions-panel {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    
    .input-panel,
    .output-panel {
        grid-column: 1;
    }
}

@media (max-width: 992px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .actions-panel {
        grid-column: 1;
        grid-row: 2;
    }
    
    .input-panel {
        grid-row: 1;
    }
    
    .output-panel {
        grid-row: 3;
    }
}

/* Panels */
.panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
/* tắt hiệu ứng 
.panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
} */

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #7dd3fc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-icon {
    font-size: 1.1rem;
}

.panel-buttons {
    display: flex;
    gap: 8px;
}

/* Code Areas */
.code-area {
    width: 100%;
    min-height: 350px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
    color: #e2e8f0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.code-area:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.code-area::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Options Grid Container */
.options-grid-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

/* Options Cards */
.options-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.options-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #38bdf8;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-icon {
    font-size: 1rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

/* Option Items */
.option-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.option-item input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #4ade80;
    border-radius: 4px;
    margin-top: 2px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}

.option-item input[type="checkbox"]:checked + .checkbox-custom {
    background: #4ade80;
    border-color: #4ade80;
}

.option-item input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.option-text {
    flex: 1;
}

.option-main {
    display: block;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 2px;
}

.option-item small {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

/* Actions Panel */
.actions-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.actions-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}
/* tắt hiệu ứng 
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
} */

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: white;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn-small {
    padding: 10px 15px;
    font-size: 14px;
    flex: 1;
}

.btn-icon {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.history-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

/* Find & Replace */
.find-replace-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.find-replace-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.find-replace-icon {
    font-size: 1rem;
}

.find-replace-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.find-input,
.replace-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.find-input:focus,
.replace-input:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.find-replace-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.find-result {
    margin-top: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
}

/* Stats Card */
.stats-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #cbd5e1;
    font-size: 14px;
}

.stat-value {
    color: #38bdf8;
    font-weight: 600;
    font-size: 14px;
}

/* Quick Actions */
.quick-actions-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-actions-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4ade80;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-actions-icon {
    font-size: 1rem;
}

.quick-actions-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* Output Info */
.output-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.output-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.output-stat {
    font-size: 13px;
    color: #94a3b8;
}

.output-stat span {
    color: #4ade80;
    font-weight: 600;
}

.output-actions {
    display: flex;
    gap: 10px;
}

/* Status Message */
.status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 24px;
    background: #22c55e;
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    font-weight: 500;
    max-width: 400px;
    word-wrap: break-word;
}

.status.active {
    opacity: 1;
    transform: translateY(0);
}

.status.error {
    background: #ef4444;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.status.warning {
    background: #f59e0b;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.status.info {
    background: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 14px;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: #38bdf8;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cleaner-container {
        padding: 15px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .description {
        font-size: 1rem;
    }
    
    .panel {
        padding: 15px;
    }
    
    .code-area {
        min-height: 250px;
    }
    
    .status {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .find-replace-buttons,
    .quick-actions-buttons {
        grid-template-columns: 1fr;
    }
    
    .output-info {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .output-actions {
        justify-content: center;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(56, 189, 248, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
} 

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Ad Placeholders */
.ad-placeholder {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    margin: 10px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure ad containers have proper sizing */
.adsbygoogle {
    width: 100%;
    min-height: 100px;
    background: transparent;
}

/* Fix ad layout */
.ad-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
}

.ad-section ins {
    width: 100% !important;
    height: auto !important;
}

/* Responsive ads */
@media (max-width: 768px) {
    .ad-section {
        padding: 10px;
        margin: 15px 0;
    }
    
    .ad-placeholder {
        padding: 20px;
        min-height: 80px;
    }
}

/* Ad loading animation */
@keyframes adPulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

.ad-placeholder {
    animation: adPulse 2s infinite;
}

/* Hide ad placeholders when ads are loaded */
.adsbygoogle[data-ad-status="filled"] + .ad-placeholder {
    display: none !important;
}

.adsbygoogle[style*="height: 0px"] + .ad-placeholder,
.adsbygoogle[style*="height:0px"] + .ad-placeholder {
    display: flex !important;
}