/* --- CSS VARIABLES & RESET --- */
:root {
    --primary: #28a745;
    --primary-hover: #218838;
    --secondary: #6c757d;
    --danger: #dc3545;
    --danger-hover: #e60000;
    --warning: #ffc107;
    --info: #17a2b8;
    
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --bg-input: #fdfdfd;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius: 12px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* =========================================================
       👇 CHANGE DESKTOP BUTTON SIZE HERE 👇
       ========================================================= */
    --btn-fixed-w: 180px; /* <--- CHANGE THIS for Width (Length) */
    --btn-fixed-h: 42px;  /* <--- CHANGE THIS for Height */
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
    padding-bottom: 80px; /* Space for mobile nav */
}

/* --- LAYOUT UTILS --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.w-full { width: 100%; }
.hidden { display: none !important; }

@media (min-width: 768px) {
    .md-grid-cols-3 { grid-template-columns: 2fr 1fr; }
    .md-flex-row { flex-direction: row; }
    body { padding-bottom: 0; }
}

/* --- COMPONENTS --- */

/* Header */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 16px 0;
    backdrop-filter: blur(10px);
    opacity: 0.98;
}
.logo-area { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    background: linear-gradient(135deg, var(--primary), #047857);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* =========================================================
   🔥 FONT CUSTOMIZATION SECTION 
   ========================================================= */

/* 1. To change font for "UltraPing Pro" */
.brand-name { 
    font-size: 1.55rem; 
    font-weight: 800; 
    letter-spacing: -0.025em;
    /* UNCOMMENT AND CHANGE LINE BELOW TO YOUR FONT */
    /* font-family: 'Times New Roman', serif; */ 
}

.brand-sub { 
    font-size: 1.0rem; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    color: var(--text-muted); 
    font-weight: 700; 
    display: block; 
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1.2rem;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.2);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 6px rgba(220, 53, 69, 0.2);
}
.btn-danger:hover { background: var(--danger-hover); transform: translateY(-1px); }

.btn-icon { padding: 8px; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; border: none; }
.btn-icon:hover { background: rgba(0,0,0,0.05); color: var(--text-main); }

/* Floating Actions */
.floating-group { z-index: 100; }
.btn-float {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.0rem;
}
.btn-float:hover { background-color: var(--danger-hover); transform: scale(1.05); }

/* Desktop Fixed Right */
@media (min-width: 768px) {
    .floating-group {
        position: fixed;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .btn-float {
        width: var(--btn-fixed-w);
        height: var(--btn-fixed-h);
    }
}
/* Mobile Fixed Bottom */
@media (max-width: 767px) {
    .floating-group {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        display: flex;
        gap: 12px;
        padding: 16px;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
    }
    .btn-float {
        flex: 1;
        /* 👇 CHANGE MOBILE HEIGHT HERE 👇 */
        height: 48px; /* <--- MOBILE HEIGHT */
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
}
.card-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-body { padding: 20px; }
.card-title { font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px; }

/* Inputs */
textarea {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    padding: 16px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 1.0rem;
    resize: none;
    transition: border-color 0.2s;
}
textarea:focus { border-color: var(--primary); }

/* Stats & Status */
.status-row {
    display: flex; justify-content: space-between; padding: 12px;
    background: var(--bg-input); border-radius: 8px; margin-bottom: 8px;
    font-size: 0.9rem; border: 1px solid var(--border);
}
.status-label { color: var(--text-muted); }
.status-val { font-weight: 700; font-family: monospace; }
.text-green { color: var(--primary); }
.text-blue { color: var(--info); }
.text-red { color: var(--danger); }

/* Progress */
.progress-container { margin-top: 20px; }
.progress-bar-bg { height: 12px; background: var(--border); border-radius: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); width: 0%; transition: width 0.3s ease; position: relative; }
.progress-bar-fill::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 1.5s infinite;
}
@keyframes shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.tab {
    flex: 1; text-align: center; padding: 16px; cursor: pointer;
    font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab:hover { background: rgba(0,0,0,0.02); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(40, 167, 69, 0.05); }

/* Logs */
.log-container { max-height: 400px; overflow-y: auto; background: var(--bg-input); }
.log-item {
    padding: 10px 16px; border-bottom: 1px solid var(--border);
    font-size: 0.85rem; display: flex; align-items: center; gap: 12px;
    animation: slideUp 0.3s ease-out;
}
.log-time { color: var(--text-muted); font-family: monospace; min-width: 60px; }
.log-status { font-weight: 800; min-width: 60px; text-transform: uppercase; font-size: 0.75rem; }
.log-status.success { color: var(--primary); }
.log-status.fail { color: var(--danger); }
.log-service { font-weight: 600; width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-url { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }

@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* SEO Cards */
.seo-card {
    background: var(--bg-card); border: 1px solid var(--border); padding: 16px;
    border-radius: 8px; margin-bottom: 12px; animation: fadeIn 0.5s;
}
.seo-header { display: flex; justify-content: space-between; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.badge-fast { background: #d1fae5; color: #065f46; }
.badge-med { background: #fef3c7; color: #92400e; }
.badge-slow { background: #fee2e2; color: #991b1b; }

/* Quick Links */
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.quick-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 10px; border: 1px solid var(--border); border-radius: 6px;
    text-decoration: none; color: var(--text-main); font-size: 0.75rem; font-weight: 700;
    transition: all 0.2s;
}
.quick-link:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* 2. To change font for "Used by users" */
.user-counter {
    background: rgba(0,0,0,0.05); 
    padding: 6px 12px; 
    border-radius: 20px;
    font-size: 0.9rem; 
    font-weight: 600; 
    color: var(--text-muted);
    display: flex; 
    align-items: center; 
    gap: 6px;
    /* UNCOMMENT AND CHANGE LINE BELOW TO YOUR FONT */
    /* font-family: 'Verdana', sans-serif; */
}
.user-counter strong { color: var(--text-main); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }