/* Kykez CMS - DailyPost Clone Style */
:root {
    --primary-color: #d0021b; /* DailyPost Red */
    --secondary-color: #222;
    --bg-color: #f4f4f4;
    --text-color: #333;
    --border-color: #ddd;
    --container-width: 1140px;
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-family); background-color: #fff; color: var(--text-color); font-size: 15px; line-height: 1.5; }
a { text-decoration: none; color: #000; transition: color 0.2s; }
a:hover { color: var(--primary-color); }
img { max-width: 100%; height: auto; display: block; }

/* Container */
.container { width: 96%; max-width: var(--container-width); margin: 0 auto; padding: 0 15px; }

/* Top Bar */
.top-bar { background: #222; color: #fff; padding: 5px 0; font-size: 12px; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.top-bar a { color: #ccc; margin-left: 10px; }
.top-bar a:hover { color: #fff; }

/* Header */
header { background: #fff; border-bottom: 2px solid var(--primary-color); padding: 15px 0; }
header .logo { margin-bottom: 15px; text-align: center; }
header .logo a { font-size: 2.5rem; font-weight: 900; color: var(--primary-color); letter-spacing: 1.5px; font-family: Impact, sans-serif; text-transform: uppercase; }

/* Navigation */
.main-nav { background: #222; color: #fff; position: relative; }
.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; padding: 0; margin: 0; justify-content: center; }
.main-nav li { }
.main-nav a { display: block; color: #fff; padding: 12px 15px; font-weight: 700; text-transform: uppercase; font-size: 13px; }
.main-nav a:hover { background: var(--primary-color); }

/* Mobile Nav Toggle */
.nav-toggle-label { display: none; color: #fff; padding: 10px; cursor: pointer; font-weight: bold; background: var(--primary-color); }
.nav-toggle { display: none; }

/* Main Layout */
.main-layout { display: flex; flex-wrap: wrap; margin-top: 20px; gap: 30px; }
.main-content { flex: 0 0 70%; max-width: 70%; }
.sidebar { flex: 0 0 27%; max-width: 27%; }

/* Featured Post */
.featured-post { position: relative; margin-bottom: 30px; }
.featured-post img { width: 100%; height: 400px; object-fit: cover; }
.featured-overlay { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.7); color: #fff; padding: 20px; }
.featured-overlay h2 { font-size: 2rem; margin-bottom: 10px; }
.featured-overlay .meta { font-size: 0.9rem; color: #ccc; }

/* Section Headers */
.section-title { font-size: 18px; font-weight: 700; color: #fff; background: var(--secondary-color); padding: 8px 15px; display: inline-block; text-transform: uppercase; margin-bottom: 15px; position: relative; }
.section-title::after { content: ''; position: absolute; top: 0; right: -20px; width: 0; height: 0; border-top: 43px solid transparent; border-left: 20px solid var(--secondary-color); border-bottom: 0px solid transparent; } /* Triangle effect */

/* News List */
.news-list { display: flex; flex-direction: column; gap: 20px; }
.news-item { display: flex; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.news-item img { width: 240px; height: 160px; object-fit: cover; flex-shrink: 0; }
.news-info { flex-grow: 1; }
.news-info h3 { font-size: 1.2rem; margin-bottom: 10px; line-height: 1.3; }
.news-info h3 a { color: #000; }
.news-info h3 a:hover { color: var(--primary-color); }
.news-excerpt { font-size: 0.9rem; color: #666; margin-bottom: 10px; }
.news-meta { 
    font-size: 0.8rem; 
    color: #595959; 
}

/* Sidebar Widgets */
.widget { margin-bottom: 30px; background: #fff; border: 1px solid #eee; padding: 15px; }
.widget h3 { border-bottom: 2px solid var(--primary-color); padding-bottom: 10px; margin-bottom: 15px; font-size: 16px; text-transform: uppercase; }
.widget ul { list-style: none; }
.widget li { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #f4f4f4; }
.widget li:last-child { border: none; }
.widget a { font-weight: 600; font-size: 14px; }

/* Tool Cards in Sidebar */
.sidebar-tool { display: flex; align-items: center; gap: 10px; }
.sidebar-tool img { width: 32px; height: 32px; }

/* Search Form */
.search-form { display: flex; }
.search-form input { flex: 1; padding: 10px; border: 1px solid #ddd; }
.search-form button { background: var(--secondary-color); color: #fff; border: none; padding: 10px 15px; cursor: pointer; }

/* Single Post */
.single-post h1 { font-size: 2.5rem; margin-bottom: 15px; line-height: 1.2; }
.post-meta { color: #777; font-size: 0.9rem; margin-bottom: 20px; border-top: 1px solid #eee; border-bottom: 1px solid #eee; padding: 10px 0; }
.post-content { font-size: 1.1rem; line-height: 1.8; color: #111; }
.post-content p { margin-bottom: 20px; }
.post-content img { margin: 20px 0; }

/* Tool Interface Override */
.tool-interface { border: 1px solid #ddd; padding: 20px; background: #fafafa; border-radius: 4px; margin-bottom: 30px; }

/* Form Elements - CONSISTENT STYLING */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 8px; color: var(--secondary-color); }
.form-control, 
input[type="text"],
input[type="email"], 
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="search"],
textarea,
select { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    font-size: 1rem; 
    font-family: var(--font-family);
    transition: border-color 0.3s;
    background: #fff;
}
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus { 
    border-color: var(--primary-color); 
    outline: none; 
}

textarea { min-height: 120px; resize: vertical; }

/* Buttons - CONSISTENT STYLING */
.btn,
button[type="submit"],
input[type="submit"] { 
    display: inline-block; 
    padding: 12px 25px; 
    border-radius: 4px; 
    font-weight: 700; 
    text-transform: uppercase; 
    border: none; 
    cursor: pointer; 
    text-align: center; 
    transition: background 0.3s;
    font-size: 0.9rem;
    font-family: var(--font-family);
}
.btn-primary,
button[type="submit"],
input[type="submit"] { 
    background: var(--primary-color); 
    color: #fff; 
}
.btn-primary:hover,
button[type="submit"]:hover,
input[type="submit"]:hover { 
    background: #b00015; 
    color: #fff; 
}
.btn-secondary { background: var(--secondary-color); color: #fff; }
.btn-secondary:hover { background: #444; color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

/* Tool Specifics */
.result-box { background: #fff; border: 1px solid #eee; padding: 20px; margin-top: 20px; border-radius: 4px; }
.thumbnail-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* Admin Styles */
.admin-container { display: flex; min-height: 100vh; }
.admin-sidebar { width: 250px; background: #333; color: #fff; padding: 20px; position: relative; transition: transform 0.3s ease; }
.admin-sidebar h3 { margin-bottom: 20px; border-bottom: 1px solid #555; padding-bottom: 10px; }
.admin-sidebar ul { list-style: none; padding: 0; }
.admin-sidebar li { margin-bottom: 10px; }
.admin-sidebar a { color: #ccc; text-decoration: none; display: block; padding: 10px; border-radius: 4px; }
.admin-sidebar a:hover { background: #444; color: #fff; }
.admin-main-content { flex: 1; padding: 20px; background: #f4f4f4; }

/* Mobile Menu Toggle for Admin */
.admin-menu-toggle { 
    display: none; 
    position: fixed; 
    top: 10px; 
    left: 10px; 
    z-index: 1001; 
    background: var(--primary-color); 
    color: #fff; 
    border: none; 
    padding: 10px 15px; 
    border-radius: 4px; 
    cursor: pointer;
    font-weight: bold;
}

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); text-align: center; }
.stat-number { font-size: 2rem; font-weight: bold; color: #007bff; }

/* Table Styles */
.table { width: 100%; border-collapse: collapse; background: #fff; margin-top: 20px; overflow-x: auto; display: block; }
.table thead { display: table; width: 100%; table-layout: fixed; }
.table tbody { display: table; width: 100%; table-layout: fixed; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }
.table th { background-color: #f8f9fa; font-weight: 700; }
.actions a { margin-right: 10px; font-size: 0.9rem; color: var(--primary-color); }
.actions a:hover { text-decoration: underline; }

/* Quill Editor */
.ql-container { height: 300px; background: #fff; }

/* Pagination */
.pagination { margin-top: 20px; text-align: center; }
.pagination a { 
    display: inline-block; 
    padding: 8px 15px; 
    margin: 0 5px; 
    background: #fff; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    color: #333;
}
.pagination a:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* Utility Classes */
.text-center { text-align: center; }
.error { background: #ffeeba; color: #856404; padding: 10px; border-radius: 4px; margin-bottom: 20px; }
.success { background: #d4edda; color: #155724; padding: 10px; border-radius: 4px; margin-bottom: 20px; }

/* Login Card */
.login-card { 
    width: 100%; 
    max-width: 400px; 
    padding: 40px; 
    background: #fff; 
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin: 20px;
}

/* ==========================================
   MOBILE RESPONSIVENESS
   ========================================== */

/* Tablet and Below */
@media (max-width: 768px) {
    /* Main Layout */
    .main-layout { flex-direction: column; gap: 20px; }
    .main-content, .sidebar { flex: 0 0 100%; max-width: 100%; }

    /* Navigation - Sidebar Style */
    .nav-toggle-label { display: block; z-index: 1005; position: relative; cursor: pointer; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        background: #222;
        z-index: 1001;
        padding-top: 80px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
        transition: transform 0.3s ease;
    }
    .nav-toggle:checked ~ ul { display: flex; }
    .main-nav a { border-bottom: 1px solid #333; text-align: left; padding: 15px 20px; font-size: 16px; }
    #nav-toggle:checked ~ .nav-toggle-label {
        position: fixed;
        top: 10px;
        left: 230px;
        color: #fff;
        z-index: 1006;
    }

    /* Admin Area - Mobile Sidebar */
    .admin-menu-toggle { display: block; }
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    .admin-sidebar.active { transform: translateX(0); }
    .admin-main-content { 
        margin-left: 0; 
        padding: 60px 15px 15px;
    }

    /* Tables - Responsive */
    .table { 
        font-size: 0.85rem; 
    }
    .table th, .table td { 
        padding: 8px; 
    }
    
    /* Hide less important columns on mobile */
    .table th:nth-child(3),
    .table td:nth-child(3),
    .table th:nth-child(4),
    .table td:nth-child(4) {
        display: none;
    }

    /* News Items */
    .news-item { gap: 15px; }
    .news-item img { width: 120px; height: 80px; }
    .news-info h3 { font-size: 1rem; }

    /* Featured Post */
    .featured-post img { height: 250px; }
    .featured-overlay { padding: 15px; }
    .featured-overlay h2 { font-size: 1.5rem; }

    /* Header */
    header .logo a { font-size: 2rem; }

    /* Stats Grid */
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
    .stat-number { font-size: 1.5rem; }

    /* Login Card */
    .login-card { padding: 30px 20px; }

    /* Buttons on Mobile */
    .btn, button[type="submit"], input[type="submit"] {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    /* Form Elements on Mobile */
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="url"],
    input[type="tel"],
    input[type="search"],
    textarea,
    select {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    /* News Items - Stack Vertically */
    .news-item { flex-direction: column; }
    .news-item img { width: 100%; height: 200px; }

    /* Top Bar */
    .top-bar .container { 
        flex-direction: column; 
        gap: 10px; 
        text-align: center;
    }

    /* Table - Card View on Small Screens */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { 
        margin-bottom: 15px; 
        border: 1px solid #ddd; 
        padding: 10px;
        border-radius: 4px;
    }
    .table td { 
        text-align: right; 
        padding: 8px 10px; 
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding-left: 50%;
    }
    .table td:before { 
        content: attr(data-label); 
        position: absolute; 
        left: 10px; 
        font-weight: bold;
        text-align: left;
    }
    .table td:last-child { border-bottom: none; }

    /* Stats Grid - Single Column */
    .stats-grid { grid-template-columns: 1fr; }

    /* Buttons - Full Width on Small Mobile */
    .btn-block,
    .actions { 
        display: flex; 
        flex-direction: column; 
        gap: 5px;
    }
    .actions a { 
        display: block; 
        margin: 0; 
        padding: 5px; 
        text-align: center;
    }
}

/* Large Screens */
@media (min-width: 1400px) {
    .container { max-width: 1320px; }
}

/* Add this to your style.css */
.news-ad-slot {
    width: 100%;
    margin: 30px 0;
    padding: 10px;
    background-color: #f9f9f9;
    text-align: center;
    display: block;
    clear: both; /* Ensures it sits on its own line */
}