/**
 * Base Styles - CrawlRabbit
 * Common styles used across all pages
 */

/* ========== CSS Reset ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-padding-top: 70px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.4;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========== Header & Navigation ========== */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: #3498db;
}

.logo img {
    width: 35px;
    height: 35px;
    margin-right: 8px;
    transition: transform 0.3s ease-in-out;
}

.logo:hover img {
    transform: translateX(10px) rotate(20deg);
}

.nav-menu {
    display: flex;
    gap: 8px;
    list-style: none;
}

.nav-menu a {
    color: #666;
    font-weight: 400;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-menu a:hover {
    background-color: #f0f0f0;
    color: #2c3e50;
}

/* ========== Common Components ========== */

/* Alerts */
.alert {
    max-width: 900px;
    margin: 20px auto;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Page Container */
.page-container {
    max-width: 900px;
    margin: 0px auto;
    padding: 0 20px;
}

.content-card {
    background: #fff; 
    padding: 32px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #777;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Headings */
h1 {
    margin-top: 0;
    font-size: 32px;
    color: #2c3e50;
}

h2 {
    font-size: 22px;
    color: #3498db;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.table td:first-child {
    width: 220px;
    color: #555;
    font-weight: 600;
}

/* Status & Indicators */
.status-ok {
    color: #27ae60;
    font-weight: 600;
}

.hidden {
    display: none;
}

/* Common Buttons */
.btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 22px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: #2980b9;
}

/* Note/Info Box */
.note {
    margin-top: 30px;
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    padding: 14px 16px;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

/* ========== Search Section ========== */
.search-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px 20px 30px;
    gap: 10px;
    flex-wrap: wrap;
}

.search-section form {
    display: flex;
    width: 100%;
    max-width: 600px;
    gap: 8px;
}

.search-section input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 4px;
    border: 2px solid #3498db;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}

.search-section input:hover {
    border-color: #999;
}

.search-section input:focus {
    border-color: #3498db;
}

.search-section button,
.search-section a {
    padding: 12px 28px;
    border: none;
    border-radius: 4px;
    background-color: #3498db;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(52,152,219,0.2);
}

.search-section button:hover,
.search-section a:hover {
    background-color: #2980b9;
    box-shadow: 0 3px 6px rgba(52,152,219,0.3);
    transform: translateY(-1px);
}

.search-section button:active,
.search-section a:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(52,152,219,0.2);
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px 0 30px;
    gap: 6px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #3498db;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination a:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.pagination .active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination .disabled {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
    pointer-events: none;
}

.page-info {
    font-size: 14px;
    color: #666;
    margin: 0 10px;
}

/* ========== Result Cards (for search, browse, homepage) ========== */
.recent-crawls {
    max-width: 938px;
    margin: 25px auto;
    padding: 0 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.result-card {
    background-color: #fff;
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(32,33,36,0.08);
    transition: box-shadow 0.2s;
    border-left: 3px solid transparent;
}

.result-card:hover {
    box-shadow: 0 1px 5px rgba(32,33,36,0.12);
    border-left-color: #3498db;
}

.result-url {
    color: #202124;
    font-size: 13px;
    margin-bottom: 4px;
}

.result-title {
    font-size: 18px;
    color: #1a0dab;
    margin-bottom: 6px;
    font-weight: 500;
    line-height: 1.3;
}

.result-title:hover {
    text-decoration: underline;
}

.result-description {
    color: #4d5156;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 6px;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.meta-item {
    margin-right: 16px;
    display: flex;
    align-items: center;
}

/* SSL Grade Badges (small inline version) */
.ssl-grade {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 11px;
    margin-left: 4px;
}

.ssl-a { background-color: #d4edda; color: #155724; }
.ssl-b { background-color: #fff3cd; color: #856404; }
.ssl-c { background-color: #f8d7da; color: #721c24; }
.ssl-a-plus { background-color: #d1ecf1; color: #0c5460; }

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .page-container {
        margin: 20px auto;
        padding: 0 15px;
    }

    .content-card {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 18px;
    }

    .search-section {
        flex-direction: column;
        align-items: center;
        margin: 20px 15px 25px;
    }

    .search-section input,
    .search-section a,
    .search-section button {
        width: 100%;
    }

    .pagination a, .pagination span {
        padding: 6px 10px;
        font-size: 13px;
    }

    .result-card {
        padding: 12px 14px;
        margin-bottom: 10px;
    }

    .result-title {
        font-size: 16px;
    }
}
