/*
 Theme Name:   AI Tools Child
 Theme URI:    https://yoursite.com
 Description:  Child theme for AI Tools Leaderboard
 Author:       Mangal Gupta
 Template:     astra
 Version:      1.0.0
 Text Domain:  mg-ai-tools
*/

/* ===== GLOBAL ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6fa;
    color: #222;
    margin: 0;
}

a { color: #5b4cdb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LEADERBOARD TABLE ===== */
.mg-leaderboard-wrapper {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.mg-leaderboard-wrapper h1 {
    font-size: 2rem;
    margin-bottom: 24px;
    color: #1a1a2e;
}

.mg-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.mg-leaderboard-table thead {
    background: #5b4cdb;
    color: #fff;
}

.mg-leaderboard-table th,
.mg-leaderboard-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.mg-leaderboard-table tr:hover td {
    background: #f0eeff;
}

.mg-leaderboard-table td:first-child {
    font-weight: bold;
    color: #5b4cdb;
    width: 40px;
}

/* ===== VOTE BUTTON ===== */
.mg-vote-btn {
    background: #5b4cdb;
    color: #fff;
    border: none;
    padding: 7px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.mg-vote-btn:hover { background: #3d2fbf; }
.mg-vote-btn:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.mg-vote-count {
    display: inline-block;
    margin-left: 8px;
    font-weight: bold;
    color: #5b4cdb;
}

/* ===== SINGLE TOOL PAGE ===== */
.mg-single-tool {
    max-width: 860px;
    margin: 40px auto;
    padding: 0 20px;
}

.mg-tool-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

.mg-tool-header img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 14px;
    background: #f4f6fa;
    border: 1px solid #e2e2e2;
    padding: 6px;
}

.mg-tool-header h1 {
    font-size: 1.8rem;
    color: #1a1a2e;
    margin: 0;
}

.mg-tool-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.mg-badge {
    background: #f0eeff;
    color: #5b4cdb;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mg-tool-visit-btn {
    display: inline-block;
    background: #5b4cdb;
    color: #fff;
    padding: 10px 28px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 28px;
    transition: background 0.2s;
}

.mg-tool-visit-btn:hover {
    background: #3d2fbf;
    color: #fff;
    text-decoration: none;
}

.mg-tool-content h2 {
    color: #1a1a2e;
    font-size: 1.3rem;
    margin-top: 32px;
}

/* ===== TOOL CARDS (archive / home) ===== */
.mg-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

.mg-tool-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    padding: 22px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.mg-tool-card:hover {
    box-shadow: 0 4px 20px rgba(91,76,219,0.15);
}

.mg-tool-card img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 14px;
    background: #f4f6fa;
    padding: 4px;
    border: 1px solid #e2e2e2;
}

.mg-tool-card h3 {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    color: #1a1a2e;
}

.mg-tool-card p {
    font-size: 0.9rem;
    color: #555;
    flex-grow: 1;
    margin: 0 0 14px 0;
    line-height: 1.5;
}

.mg-tool-card a.mg-card-link {
    color: #5b4cdb;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== STATIC PAGES ===== */
.mg-static-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 36px;
    line-height: 1.8;
}

.mg-static-page h1 { color: #1a1a2e; margin-top: 0; }
.mg-static-page h2 { color: #5b4cdb; font-size: 1.2rem; margin-top: 28px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .mg-leaderboard-table th:nth-child(3),
    .mg-leaderboard-table td:nth-child(3) { display: none; }

    .mg-tool-header { flex-direction: column; align-items: flex-start; }

    .mg-tools-grid { grid-template-columns: 1fr; }
}
