@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #080B10;
    --card-bg: rgba(17, 24, 39, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --accent-cyan: #00F2FE;
    --accent-blue: #4FACFE;
    --accent-glow: rgba(0, 242, 254, 0.15);
    --success: #00F5A0;
    --error: #FF5E62;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: #05070f;
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(79, 172, 254, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(0, 242, 254, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 65%);
}

.perspective-grid {
    position: fixed;
    bottom: -150px;
    left: -50%;
    width: 200%;
    height: 450px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath d='M14 0 L28 8.08 L28 24.25 L14 32.33 L0 24.25 L0 8.08 Z M0 24.25 L14 32.33 L14 48.5 L0 40.42 Z M28 24.25 L14 32.33 L14 48.5 L28 40.42 Z' stroke='rgba%280, 242, 254, 0.22%29' stroke-width='1' fill='none'/%3E%3C/svg%3E");
    background-size: 28px 49px;
    transform: perspective(220px) rotateX(55deg);
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 35%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 35%, rgba(0,0,0,0) 100%);
    z-index: -2;
    pointer-events: none;
    opacity: 0.95;
    filter: drop-shadow(0 0 12px rgba(0, 242, 254, 0.55));
}

.rising-lines {
    position: fixed;
    bottom: 0;
    left: 20px;
    width: 250px;
    height: 60vh;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='500' viewBox='0 0 250 500' fill='none'%3E%3Cline x1='30' y1='500' x2='30' y2='100' stroke='rgba(0,242,254,0.18)' stroke-dasharray='4 4'/%3E%3Ccircle cx='30' cy='150' r='3.5' fill='%2300F2FE' fill-opacity='0.8'/%3E%3Ccircle cx='30' cy='320' r='2.5' fill='%2300F2FE' fill-opacity='0.6'/%3E%3Cline x1='90' y1='500' x2='90' y2='200' stroke='rgba(79,172,254,0.12)' stroke-dasharray='3 3'/%3E%3Ccircle cx='90' cy='250' r='3.5' fill='%234FACFE' fill-opacity='0.7'/%3E%3Cline x1='160' y1='500' x2='160' y2='50' stroke='rgba(0,242,254,0.2)' stroke-dasharray='6 6'/%3E%3Ccircle cx='160' cy='80' r='4' fill='%2300F2FE' fill-opacity='0.85'/%3E%3Ccircle cx='160' cy='290' r='2.5' fill='%2300F2FE' fill-opacity='0.7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: bottom left;
    mask-image: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    z-index: -2;
    pointer-events: none;
    opacity: 0.95;
    filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.4));
}

/* Background animation grid */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.005) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.005) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
}

header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-bell {
    color: var(--text-secondary);
    position: relative;
}

.header-bell:hover {
    color: var(--text-primary);
}

.btn-new-link {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #000000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 242, 254, 0.15);
    transition: var(--transition);
}

.btn-new-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 242, 254, 0.25);
    filter: brightness(1.1);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.1);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 2rem;
    width: 100%;
    margin: 0 auto;
}

/* Login Panel Styling */
.login-card {
    max-width: 400px;
    width: 100%;
    margin: 6rem auto;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

/* Dashboard Panel Styling */
.dashboard-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.title-left h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.title-left p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 2-Column Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    width: 100%;
    align-items: start;
}

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.toolbar {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.85rem 1.25rem 0.85rem 3rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input-wrapper input:focus {
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
}

.filter-select-wrapper {
    display: flex;
    align-items: center;
}

.select-filter {
    padding: 0.85rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.select-filter:focus {
    border-color: var(--accent-cyan);
}

/* Links Table Wrapper */
.table-wrapper {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow-x: auto;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
}

td {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

.table-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.table-link:hover {
    text-decoration: underline;
}

.table-long-link {
    color: var(--text-secondary);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-notes {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.75;
    margin-top: 0.25rem;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-hits {
    background: rgba(0, 242, 254, 0.08);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.15);
}

.badge-expiry {
    background: rgba(255, 94, 98, 0.08);
    color: var(--error);
    border: 1px solid rgba(255, 94, 98, 0.15);
}

.badge-never {
    background: rgba(0, 245, 160, 0.08);
    color: var(--success);
    border: 1px solid rgba(0, 245, 160, 0.15);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot-active {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.dot-expired {
    background-color: var(--error);
    box-shadow: 0 0 8px var(--error);
}

.table-sparkline {
    width: 100px;
    height: 30px;
    display: block;
}

/* Icon Buttons inside Actions */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-delete:hover {
    color: var(--error);
    background: rgba(255, 94, 98, 0.08);
}

/* Sidebar statistics columns */
.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.sidebar-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.8;
}

.card-metric {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

.card-metric:last-of-type {
    margin-bottom: 1rem;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.metric-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: #ffffff;
}

.metric-link {
    font-size: 0.95rem;
    color: var(--accent-cyan);
    font-weight: 500;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
}

.metric-link:hover {
    text-decoration: underline;
}

.sidebar-chart-wrapper {
    margin-top: 1.25rem;
    width: 100%;
}

.sidebar-sparkline {
    width: 100%;
    height: 60px;
    display: block;
}

/* Circular click share donut chart card */
.chart-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    width: 100%;
    text-align: left;
}

.donut-chart-container {
    position: relative;
    width: 130px;
    height: 130px;
    margin-bottom: 1.5rem;
}

.donut-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.legend-label {
    flex: 1;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.legend-value {
    font-weight: 600;
    color: #ffffff;
}

/* Modals Overlay style */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modalFadeIn 0.3s ease-out forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

input[type="text"], input[type="url"], input[type="password"], input[type="date"] {
    width: 100%;
    padding: 0.85rem 1.15rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

input:focus {
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.05);
}

.btn {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border: none;
    border-radius: 10px;
    color: #000000;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.15);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 242, 254, 0.3);
    filter: brightness(1.1);
}

/* Toast Notifications styling */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 3000;
}

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

.toast-success svg {
    color: var(--success);
}

.toast-error svg {
    color: var(--error);
}

footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: auto;
}
