/* ==================================================
   文字数カウント - Premium UI Styles
   style.css
================================================== */

/* Base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --radius: 1rem;
}

/* Smooth theme transitions */

html,
body,
header,
main,
section,
div,
button,
textarea,
a {
    transition:
        background-color .25s ease,
        border-color .25s ease,
        color .25s ease,
        box-shadow .25s ease,
        transform .25s ease;
}

/* ==================================================
   Navigation
================================================== */

.nav-link {
    color: rgb(100 116 139);
    font-weight: 500;
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    color: rgb(79 70 229);
}

.dark .nav-link {
    color: rgb(148 163 184);
}

.dark .nav-link:hover {
    color: rgb(165 180 252);
}

/* ==================================================
   Theme Toggle
================================================== */

.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgb(226 232 240);
    background: white;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    font-size: 1rem;
    font-weight: 600;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.dark .theme-toggle {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
}

/* ==================================================
   Advertisement Areas
================================================== */

.ad-box {
    border: 2px dashed rgb(203 213 225);
    border-radius: 16px;
    background: white;

    height: 96px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: rgb(100 116 139);

    margin-bottom: 1.5rem;
}

.dark .ad-box {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
    color: rgb(148 163 184);
}

.mobile-ad {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;

    z-index: 40;

    height: 60px;

    border-radius: 12px;
    border: 2px dashed rgb(203 213 225);

    background: white;

    display: flex;
    align-items: center;
    justify-content: center;

    color: rgb(100 116 139);

    font-size: .85rem;
}

.dark .mobile-ad {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
    color: rgb(148 163 184);
}

@media (min-width: 768px) {
    .mobile-ad {
        display: none;
    }
}

/* ==================================================
   Preset Buttons
================================================== */

.preset-btn {
    border: 1px solid rgb(199 210 254);
    background: rgb(238 242 255);

    color: rgb(67 56 202);

    border-radius: 999px;

    padding: .6rem 1rem;

    font-size: .875rem;
    font-weight: 600;
}

.preset-btn:hover {
    transform: translateY(-1px);
}

.dark .preset-btn {
    background: rgba(79,70,229,.15);
    border-color: rgba(99,102,241,.35);
    color: rgb(165 180 252);
}

.preset-clear {
    border: 1px solid rgb(226 232 240);
    background: rgb(248 250 252);

    color: rgb(71 85 105);

    border-radius: 999px;

    padding: .6rem 1rem;

    font-size: .875rem;
    font-weight: 600;
}

.dark .preset-clear {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
    color: rgb(148 163 184);
}

/* ==================================================
   Status Badges
================================================== */

.status-badge {
    padding: .5rem .85rem;

    border-radius: 999px;

    background: rgb(224 231 255);
    color: rgb(67 56 202);

    font-size: .875rem;
    font-weight: 600;
}

.dark .status-badge {
    background: rgba(79,70,229,.15);
    color: rgb(165 180 252);
}

.over-badge {
    padding: .5rem .85rem;

    border-radius: 999px;

    background: rgb(254 226 226);
    color: rgb(185 28 28);

    font-size: .875rem;
    font-weight: 700;
}

.dark .over-badge {
    background: rgba(220,38,38,.18);
    color: rgb(252 165 165);
}

/* ==================================================
   Textarea States
================================================== */

.limit-danger {
    border-color: rgb(239 68 68) !important;

    box-shadow:
        0 0 0 4px rgba(239,68,68,.12);
}

/* ==================================================
   Utility Buttons
================================================== */

.utility-btn,
.utility-btn-primary,
.utility-btn-danger {
    min-height: 48px;

    border-radius: 14px;

    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.utility-btn {
    background: white;
    border: 1px solid rgb(226 232 240);
}

.utility-btn:hover {
    background: rgb(248 250 252);
}

.dark .utility-btn {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
    color: rgb(226 232 240);
}

.utility-btn-primary {
    background: rgb(79 70 229);
    color: white;
    border: none;
}

.utility-btn-primary:hover {
    background: rgb(67 56 202);
}

.utility-btn-danger {
    background: rgb(220 38 38);
    color: white;
    border: none;
}

.utility-btn-danger:hover {
    background: rgb(185 28 28);
}

/* ==================================================
   Analytics Cards
================================================== */

.stat-card {
    background: white;
    border: 1px solid rgb(226 232 240);

    border-radius: 18px;

    padding: 1.25rem;

    display: flex;
    flex-direction: column;
    gap: .65rem;

    min-height: 115px;
}

.stat-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 30px rgba(15,23,42,.06);
}

.dark .stat-card {
    background: rgb(15 23 42);
    border-color: rgb(30 41 59);
}

.stat-card span {
    font-size: .875rem;
    color: rgb(100 116 139);
}

.dark .stat-card span {
    color: rgb(148 163 184);
}

.stat-card strong {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

/* ==================================================
   Toast
================================================== */

.toast {
    position: fixed;

    right: 20px;
    bottom: 90px;

    z-index: 999;

    padding: .9rem 1rem;

    border-radius: 12px;

    background: rgb(15 23 42);
    color: white;

    box-shadow:
        0 15px 40px rgba(0,0,0,.25);

    opacity: 0;
    visibility: hidden;

    transform: translateY(20px);

    transition:
        opacity .25s ease,
        transform .25s ease,
        visibility .25s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==================================================
   Premium Scrollbar
================================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgb(203 213 225);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(148 163 184);
}

.dark ::-webkit-scrollbar-thumb {
    background: rgb(51 65 85);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgb(71 85 105);
}

/* ==================================================
   Mobile Polish
================================================== */

@media (max-width: 640px) {

    .stat-card {
        min-height: 105px;
        padding: 1rem;
    }

    .stat-card strong {
        font-size: 1.4rem;
    }

    .toast {
        left: 12px;
        right: 12px;
        bottom: 82px;
        text-align: center;
    }
}
