@charset "utf-8";

/* =========================================================
   GLOBAL
========================================================= */

:root {
    --primary-color: #3667c0;
    --primary-hover: #2d56a1;
    --text-color: #222;
    --text-light: #666;
    --background-color: #ffffff;
    --card-background: #f7f9fc;
    --border-color: #dfe5ef;
    --success-color: #1c9c5e;
    --danger-color: #d9534f;

    --container-width: 980px;

    --radius: 14px;

    --shadow-light:
        0 2px 8px rgba(0,0,0,0.04);

    --shadow-medium:
        0 6px 20px rgba(0,0,0,0.08);
}

/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--background-color);
    color: var(--text-color);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;

    font-size: 16px;
    line-height: 1.7;
}

/* =========================================================
   LINKS
========================================================= */

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

/* =========================================================
   IMAGES
========================================================= */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================================
   LAYOUT
========================================================= */

.container {
    width: 92%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* =========================================================
   HEADER
========================================================= */

.site-header {

    background: #f1f3f6;
    border-bottom: 1px solid #d9dee7;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.03);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
}

.logo a {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111;
}

.logo span {
    color: var(--primary-color);
}

/* =========================================================
   NAVIGATION
========================================================= */

.main-nav ul {
    display: flex;
    align-items: center;
    gap: 22px;

    list-style: none;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* =========================================================
   MAIN
========================================================= */

main {
    padding: 35px 0 60px;
}

/* =========================================================
   CATEGORY CARDS
========================================================= */

.categories-section {
    margin-bottom: 28px;
}

.categories-grid {

    display: flex;
    flex-wrap: wrap;

    gap: 12px;

    margin-top: 18px;
}

.category-card {

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 16px;

    background: #f7f9fc;

    border: 1px solid #e6ebf2;

    border-radius: 999px;

    color: #222;

    font-size: 0.92rem;
    font-weight: 600;

    line-height: 1;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;

    box-shadow:
        0 2px 6px rgba(0,0,0,0.03);
}

.category-card:hover {

    background: #eef3ff;

    border-color: #cfd9f0;

    transform: translateY(-2px);

    box-shadow:
        0 8px 18px rgba(0,0,0,0.06);
}

.category-icon {

    font-size: 1rem;

    line-height: 1;

    flex-shrink: 0;
}

.category-title {

    white-space: nowrap;
}

/* =========================================================
   CATEGORY MOBILE
========================================================= */

@media (max-width: 768px) {

    .categories-grid {
        gap: 10px;
    }

    .category-card {

        padding: 9px 14px;

        font-size: 0.88rem;
    }

}

/* =========================================================
   TOOL CONTAINER
========================================================= */

.tool-container {
    background: var(--card-background);

    border-radius: var(--radius);

    padding: 35px;

    box-shadow: var(--shadow-light);

    margin-bottom: 30px;
}

/* =========================================================
   SEARCH TOOL
========================================================= */

.search-tools {
    position: relative;
    max-width: 700px;
    margin: 30px 0px;
}

#toolSearch {
    margin-bottom: 0;
}

#searchResults {

    position: absolute;

    top: 100%;
    left: 0;
    right: 0;

    background: #fff;

    border: 1px solid #dfe5ef;

    border-radius: 12px;

    margin-top: 8px;

    overflow: hidden;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.08);

    z-index: 1000;

    display: none;
}

.search-result-item {

    display: block;

    padding: 14px 18px;

    border-bottom: 1px solid #eef2f7;

    color: #222;

    transition: background 0.15s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f5f7fb;
}
.search-result-item {

    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-icon {

    font-size: 1.2rem;
}

.search-result-title {

    font-weight: 600;
}
/* =========================================================
   TITLES
========================================================= */

h1,
h2,
h3,
h4 {
    line-height: 1.3;
    margin-bottom: 18px;
    font-weight: 700;
}

h1 {
    font-size: 2.2rem;
}

h2 {
    font-size: 1.6rem;
    margin-top: 40px;
}

h3 {
    font-size: 1.25rem;
    margin-top: 30px;
}

p {
    margin-bottom: 18px;
    color: var(--text-light);
}

/* =========================================================
   TOOL BOX
========================================================= */

.tool-box {
    background: #f8faff;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    padding: 50px 30px;
    margin: 30px 0;
}

.tool-box input[type="file"] {
    border: 2px dashed #cfd7e6;
    background: #fff;
    padding: 40px 20px;
}

.tools-grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(260px, 1fr));

    gap: 24px;

    margin-top: 30px;
}

.tool-card {

    display: flex;
    flex-direction: column;

    background: #fff;

    border-radius: 16px;

    padding: 24px;

    border: 1px solid #e6ebf2;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;

    box-shadow:
        0 2px 8px rgba(0,0,0,0.03);

    color: #111;
}

.tool-card:hover {

    transform: translateY(-4px);

    box-shadow:
        0 12px 28px rgba(0,0,0,0.08);
}

.tool-header {

    display: flex;
    align-items: center;

    gap: 14px;

    margin-bottom: 16px;
}

.tool-icon {

    font-size: 1.8rem;

    flex-shrink: 0;
}

.tool-card h3 {

    font-size: 1.35rem;

    line-height: 1.3;

    margin: 0;

    color: #111;
}

.tool-description {

    color: #666;

    line-height: 1.6;

    margin-bottom: 0px;

    flex-grow: 1;
}

.tool-badge {

    display: inline-flex;
    align-items: center;

    align-self: flex-start;

    padding: 6px 12px;

    border-radius: 999px;

    background: #eef3ff;

    color: #3667c0;

    font-size: 0.8rem;

    font-weight: 600;
}

/* =========================================================
   FORMS
========================================================= */

input,
textarea,
select {
    width: 100%;

    padding: 14px 16px;

    border: 1px solid var(--border-color);

    border-radius: 10px;

    font-size: 1rem;

    background: #fff;

    margin-bottom: 18px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;

    border-color: var(--primary-color);

    box-shadow:
        0 0 0 3px rgba(54,103,192,0.12);
}

/* =========================================================
   FILE INPUT
========================================================= */

input[type="file"] {
    padding: 18px;
    background: #fff;
    cursor: pointer;
}

/* =========================================================
   BUTTONS
========================================================= */

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-color);
    color: #fff;

    border: none;
    border-radius: 10px;

    padding: 14px 24px;

    min-width: 220px;
    min-height: 56px;

    font-size: 1.1rem;
    font-weight: 600;

    cursor: pointer;

    text-decoration: none;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

button:hover,
.btn:hover {
    background: var(--primary-hover);
    color: #fff;

    transform: translateY(-1px);
}

.btn:visited {
    color: #fff;
}

/* =========================================================
   RESULT BOX
========================================================= */

.result-box {
    background: #f8faff;

    border: 1px solid var(--border-color);

    border-radius: var(--radius);

    padding: 25px;

    margin-top: 30px;
    
    text-align: center;
}

.result-box .btn {
    margin-top: 20px;
}

/* =========================================================
   ALERTS
========================================================= */

.alert-success {
    background: rgba(28,156,94,0.1);
    color: var(--success-color);

    padding: 14px 18px;

    border-radius: 10px;

    margin: 20px 0;
}

.alert-error {
    background: rgba(217,83,79,0.1);
    color: var(--danger-color);

    padding: 14px 18px;

    border-radius: 10px;

    margin: 20px 0;
}

/* =========================================================
   FAQ
========================================================= */

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}

.faq-item h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* =========================================================
   TABLES
========================================================= */

table {
    width: 100%;
    border-collapse: collapse;

    margin: 25px 0;
}

table th,
table td {
    border: 1px solid var(--border-color);

    padding: 14px;

    text-align: left;
}

table th {
    background: #f0f4fb;
}

/* =========================================================
   ADSENSE
========================================================= */

.ad-container {
    margin: 35px 10px;
    text-align: center;
}

/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    background: #fff;

    border-top: 1px solid var(--border-color);

    padding: 30px 0;

    margin-top: 50px;
}

.footer-inner {
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* =========================================================
   UTILITIES
========================================================= */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mt-40 {
    margin-top: 40px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-40 {
    margin-bottom: 40px;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
#upload-area {
    margin-bottom: 25px;
}
#upload-area input[type="file"] {
    width: 100%;
}
input[type="range"] {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}

#qualityValue {
    font-weight: 700;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 768px) {

    .header-inner {
        flex-direction: column;
        justify-content: center;
        align-items: left;
        padding: 15px 0;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;

        margin-top: 12px;
    }

    main {
        padding-top: 25px;
    }

    .tool-container {
        padding: 22px;
    }

    .tool-box {
        padding: 22px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    button,
    .btn {
        width: 100%;
    }
}