/* RESET DAN BASE */
html, body {
    min-height: 100vh;
    margin: 0; padding: 0;
    background: #161e2e !important;
    color: #fff;
    font-family: 'Inter', 'Nunito', Arial, sans-serif;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden !important;
}
*, *::before, *::after { box-sizing: inherit; }

/* NAVBAR HEADER */
.navbar {
    background: #1d2640;
    width: 100vw;
    max-width: 100vw;
    box-shadow: 0 2px 8px #0002;
    padding: 0;
    z-index: 1001;
    position: sticky;
    top: 0;
}
.navbar-content {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 2vw;
    height: 62px;
    position: relative;
}
.brand-logo {
    height: 39px;
    margin-right: 18px;
    display: block;
}
.nav-menu {
    list-style: none;
    display: flex;
    gap: 28px;
    margin: 0;
    padding: 0;
    align-items: center;
    margin-left: auto;
}
.nav-menu li a {
    color: #b2bbd6;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.08em;
    padding: 11px 16px;
    border-radius: 7px;
    display: flex; align-items: center; gap: 6px;
    transition: color .16s, background .15s;
}
.nav-menu li a:hover, .nav-menu li a.active {
    background: #ffc048;
    color: #1d2640;
}
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-left: 15px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 7px;
}
.hamburger span {
    display: block;
    width: 28px;
    height: 3.3px;
    background: #ffc048;
    border-radius: 3px;
}
@media (max-width: 800px) {
    .navbar-content { flex-wrap: wrap; height: unset; }
    .nav-menu {
        position: absolute;
        top: 62px; left: 0; right: 0;
        background: #232b47;
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 0 12px 14px;
        border-radius: 0 0 18px 18px;
        gap: 7px;
        display: none;
        z-index: 1002;
        box-shadow: 0 12px 24px #161e2e88;
    }
    .nav-menu.open { display: flex; }
    .hamburger { display: flex; }
}

/* CARD UTAMA */
.main-section {
    max-width: 900px;
    margin: 34px auto 0;
    padding: 0 12px;
}
.card {
    background: #1d2640;
    box-shadow: 0 3px 30px #0e19394d;
    border-radius: 18px;
    padding: 30px 22px;
    margin-bottom: 28px;
}
.section-title {
    font-size: 1.29rem;
    font-weight: 700;
    color: #ffc048;
    margin: 18px 0 18px;
    letter-spacing: 0.4px;
}

/* FORM FLEX */
.form-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    align-items: flex-end;
}
.form-flex form {
    flex: 1 1 250px;
    display: flex;
    gap: 6px;
}
.form-flex input[type="url"], .form-flex input[type="text"] {
    padding: 14px 13px;
    font-size: 1.05rem;
    border: 1.7px solid #222b45;
    border-radius: 10px;
    outline: none;
    background: #172034;
    color: #fff;
    transition: border 0.14s, background 0.17s;
}
.form-flex input:focus { border-color: #ffc048; background: #1d2640; }
.form-flex button {
    padding: 0 21px;
    background: linear-gradient(95deg, #ffa231, #ffc048 85%);
    color: #222;
    font-weight: 700;
    font-size: 1.07em;
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 10px #ffa23123;
    cursor: pointer;
    transition: background 0.18s, color 0.13s;
    display: flex; align-items: center; gap: 7px;
}
.form-flex button:hover { background: #ffc048; color: #1d2640; }

/* SHORTLINK CARD */
.url-list {
    display: flex;
    flex-direction: column;
    gap: 17px;
    margin-top: 14px;
}
.url-card {
    background: #1d2640;
    box-shadow: 0 4px 18px #0e19394d;
    border-radius: 17px;
    padding: 16px 15px;
    margin-bottom: 11px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border: 1.5px solid #222b45;
    position: relative;
}
.url-card:hover { border-color: #ffc048; box-shadow: 0 7px 26px #ffc04824; }
.qr-code img {
    width: 37px; height: 37px;
    border-radius: 7px;
    box-shadow: 0 2px 8px #ffc0481c;
    background: #232b47;
}
.url-info { flex: 1 1 210px; min-width: 0; }
.short-url {
    display: flex;
    align-items: center;
    font-size: 1.06rem;
    font-weight: 700;
    gap: 7px;
    margin-bottom: 4px;
    word-break: break-all;
    color: #ffc048;
}
.short-url a {
    color: #ffc048;
    text-decoration: none;
    border-bottom: 2px solid #ffd18033;
    transition: color .15s;
    word-break: break-all;
}
.short-url a:hover { color: #fff; border-bottom: 2px solid #ffc048; }
.copy-icon {
    color: #ffc048;
    font-size: 1.11em;
    background: #232b47;
    border-radius: 8px;
    padding: 4px 8px;
    margin-left: 4px;
    cursor: pointer;
    transition: background .18s, color .14s, transform .14s;
    display: flex; align-items: center;
}
.copy-icon:hover { background: #ffc04833; color: #fff; transform: scale(1.06);}
.long-url {
    font-size: 0.97em;
    color: #b2bbd6;
    display: flex; align-items: center; gap: 5px;
    word-break: break-all;
}
.favicon {
    width: 15px; height: 15px;
    border-radius: 3.5px;
    background: #232b47;
    margin-right: 2px;
    box-shadow: 0 2px 6px #ffc04810;
}

/* BUTTON & BADGE */
.url-actions { display: flex; flex-direction: row; gap: 9px; align-items: center; margin-left: 7px;}
.stat-link.inline-stat {
    background: #232b47;
    color: #ffc048;
    border: none;
    padding: 7px 13px;
    border-radius: 7px;
    font-size: 1em;
    font-weight: 700;
    box-shadow: 0 2px 6px #ffc04810;
    transition: background .16s, color .13s;
    display: flex; align-items: center; gap: 7px;
    text-decoration: none;
}
.stat-link.inline-stat .click-count { color: #fff; font-weight: 700; }
.stat-link.inline-stat:hover { background: #ffc048; color: #232b47;}
.gear-group { display: flex; flex-direction: row; gap: 7px; }
.gear-icon {
    background: #232b47;
    border: none;
    border-radius: 8px;
    padding: 6px 9px;
    color: #ffc048;
    font-size: 1.13em;
    cursor: pointer;
    transition: background .13s, color .13s;
    box-shadow: 0 1px 6px #ffa23108;
}
.gear-icon:hover { background: #ffc04844; color: #fff; }

/* GLOBAL DROPDOWN */
#global-dropdown {
    position: absolute;
    z-index: 10005;
    min-width: 265px;
    max-width: 99vw;
    background: #232b47;
    box-shadow: 0 9px 36px #ffc04828;
    border: 1.7px solid #ffc04899;
    border-radius: 16px;
    padding: 16px 15px 12px;
    display: none;
    opacity: 0;
    transition: opacity .16s;
}
#global-dropdown.show { display: block; opacity: 1;}
#global-dropdown .dropdown-content label {
    font-weight: 600;
    font-size: 1em;
    color: #b2bbd6;
    margin: 7px 0 2px 1px;
    display: block;
}
#global-dropdown .dropdown-content input[type="text"] {
    width: 100%;
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 7px;
    border: 1.2px solid #ffc04866;
    background: #161e2e;
    color: #fff;
}
#global-dropdown .dropdown-content button {
    background: linear-gradient(97deg, #ffa231, #ffc048 85%);
    color: #232b47;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 8px 0;
    margin: 6px 2px;
    width: 49%;
    cursor: pointer;
    transition: background .15s;
}
#global-dropdown .dropdown-content button.delete-btn {
    background: #e74c3c;
    color: #fff;
}
#global-dropdown .dropdown-content button.delete-btn:hover { background: #c0392b;}
#global-dropdown .dropdown-content button:hover {
    background: #ffc048;
    color: #232b47;
}
#global-dropdown .stat-link {
    display: block;
    margin-top: 10px;
    background: #232b47;
    color: #ffc048;
    border-radius: 7px;
    padding: 6px 10px;
    text-align: center;
    text-decoration: none;
}
#global-dropdown .stat-link:hover {
    background: #ffc048;
    color: #232b47;
}

/* PAGINATION & BACK */
.pagination {
    display: flex;
    justify-content: center;
    margin: 15px 0 14px;
    gap: 7px;
    flex-wrap: wrap;
}
.pagination a {
    padding: 7px 13px;
    background-color: #232b47;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #222b45;
    font-size: 15px;
    transition: background-color 0.16s;
}
.pagination a:hover, .pagination a.active {
    background-color: #ffc048;
    color: #232b47;
    border-color: #ffc048;
    font-weight: bold;
    pointer-events: none;
}
.btn-export {
    display: inline-block;
    margin: 10px 0 12px;
    padding: 8px 17px;
    background-color: #ffc048;
    color: #1d2640;
    border-radius: 7px;
    text-decoration: none;
    font-size: 15px;
    border: none;
    font-weight: 600;
    transition: background-color 0.17s;
}
.btn-export:hover { background-color: #ffa231; color: #fff;}
.back-link {
    display: inline-block;
    margin-top: 17px;
    padding: 8px 14px;
    background-color: #ffc048;
    color: #1d2640;
    text-decoration: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.18s;
}
.back-link:hover { background-color: #ffa231; color: #fff;}

/* TABLE */
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 15px;
    font-size: 15px;
    background: #232b47;
    color: #fff;
    border-radius: 11px;
    overflow: hidden;
}
th, td {
    padding: 12px 15px;
    border: 1px solid #222b45;
    text-align: left;
}
th {
    background-color: #222b45;
    color: #ffc048;
    font-weight: bold;
}
tr:nth-child(even) { background-color: #20293e;}
tr:hover { background-color: #222b45;}

/* STATS CARD */
.container-stats {
    padding: 22px 7px;
    background: #1d2640;
    box-shadow: 0 3px 16px #00787913;
    border-radius: 15px;
    margin-top: 22px;
}

/* FOOTER */
.footer {
    font-size: 14px;
    padding: 16px 0 9px;
    text-align: center;
    color: #b2bbd6;
    background: none;
    margin-top: 44px;
    letter-spacing: 0.04em;
}

/* RESPONSIVE DESIGN */
@media (max-width: 700px) {
    .main-section, .card, .url-list, .container-stats {
        margin: 0 auto 10px;
    }
    .navbar-content { padding: 10px 2vw !important; }
    .brand-logo { height: 33px;}
    .form-flex, .input-group, .input-wrapper {
        flex-direction: column;
        width: 100%;
    }
    .form-flex input, .form-flex button, .input-group input, .input-group button, .input-wrapper input, .input-wrapper button {
        width: 100% !important;
        max-width: 100%;
        font-size: 15px;
        min-width: 0;
    }
    .url-card { padding: 10px 1vw !important; margin: 4px 0; border-radius: 11px;}
    .short-url, .long-url { font-size: 13px;}
    .qr-code img { width: 28px !important; height: 28px !important;}
}

/* Scrollbar dark */
::-webkit-scrollbar {
    width: 9px;
    background: #1d2640;
}
::-webkit-scrollbar-thumb {
    background: #222b45;
    border-radius: 7px;
}

@media (max-width: 600px) {
  .form-flex {
    flex-direction: row !important;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .form-flex form {
    display: flex !important;
    flex-direction: row !important;
    flex: 0 0 auto;
    gap: 7px;
    align-items: center;
    width: auto;
  }
  .form-flex input[type="url"],
  .form-flex input[type="text"] {
    width: 115px !important;
    min-width: 90px;
    font-size: 14px;
    border-radius: 8px;
    margin-bottom: 0;
    flex: 1 1 auto;
  }
  .form-flex button {
    padding: 0 13px;
    width: auto !important;
    border-radius: 8px;
    font-size: 14px;
    margin: 0;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  /* Scrollbar halus jika kepanjangan */
  .form-flex::-webkit-scrollbar { height: 5px; background: #21293a; }
  .form-flex::-webkit-scrollbar-thumb { background: #323e59; border-radius: 6px; }
}

.login-box {
    background: #202842;
    padding: 38px 30px 28px;
    border-radius: 17px;
    box-shadow: 0 5px 32px #0006;
    max-width: 390px;
    width: 100%;
    margin: 60px auto;
    text-align: center;
}
.header-logo img {
    height: 44px;
    margin-bottom: 15px;
}
h2 {
    color: #ffc048;
    margin-bottom: 23px;
    font-size: 1.28em;
    font-weight: 800;
    letter-spacing: .5px;
}

.error {
    background: #2e2332;
    color: #ffc048;
    border: 1px solid #ff7675;
    padding: 12px 10px;
    border-radius: 7px;
    margin-bottom: 18px;
    font-size: 14.5px;
    font-weight: 600;
}
.success {
    background: #22332e;
    color: #27ae60;
    border: 1px solid #27ae60;
    padding: 12px 10px;
    border-radius: 7px;
    margin-bottom: 18px;
    font-size: 14.5px;
    font-weight: 600;
}
.register-link {
    text-align: center;
    margin-top: 19px;
    font-size: 14px;
    color: #ffc048;
    letter-spacing: 0.01em;
}
.register-link a {
    color: #ffe08a;
    text-decoration: underline;
    font-weight: 700;
    transition: color .17s;
}
.register-link a:hover {
    color: #ffa231;
}
@media (max-width: 550px) {
    .login-box {
        padding: 25px 10px 20px;
        border-radius: 9px;
    }
    h2 { font-size: 1em;}
}

.register-box {
    background: #202842;
    padding: 38px 30px 28px;
    border-radius: 17px;
    box-shadow: 0 5px 32px #0006;
    max-width: 390px;
    width: 100%;
    margin: 60px auto;
    text-align: center;
}

.login-link {
    text-align: center;
    margin-top: 19px;
    font-size: 14px;
    color: #ffc048;
    letter-spacing: 0.01em;
}
.login-link a {
    color: #ffe08a;
    text-decoration: underline;
    font-weight: 700;
    transition: color .17s;
}
.login-link a:hover {
    color: #ffa231;
}
@media (max-width: 550px) {
    .register-box {
        padding: 25px 10px 20px;
        border-radius: 9px;
    }
    h2 { font-size: 1em;}
}