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

body {
    font-family: "Inter", sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
    transition:
        background 0.5s ease,
        color 0.3s ease;
}

.background-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20vw; /* Make it very large relative to viewport width */
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05); /* Very light white for transparency */
    pointer-events: none; /* Ensure it doesn't interfere with clicks */
    user-select: none; /* Prevent text selection */
    white-space: nowrap; /* Keep text on one line */
    z-index: -1; /* Place it behind other content */
    opacity: 0.3;
}

body.light-theme {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #1a1a1a;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

.theme-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.light-theme .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.light-theme .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.theme-icon {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.light-theme .theme-icon {
    stroke: #1a1a1a;
}

.sun-icon {
    display: none;
}

.light-theme .sun-icon {
    display: block;
}

.moon-icon {
    display: block;
}

.light-theme .moon-icon {
    display: none;
}

.moon-icon {
    fill: #ffffff;
    stroke: none;
}

.light-theme .sun-icon {
    fill: #fbbf24;
    stroke: #fbbf24;
}

.view-toggle {
    position: fixed;
    top: 30px;
    right: 150px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.light-theme .view-toggle {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.view-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.light-theme .view-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.view-icon {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.light-theme .view-icon {
    stroke: #1a1a1a;
}

.grid-icon {
    display: block;
    fill: #ffffff;
}

.light-theme .grid-icon {
    fill: #1a1a1a;
}

.list-icon {
    display: none;
}

.list-view-active .grid-icon {
    display: none;
}

.list-view-active .list-icon {
    display: block;
}

.admin-icon {
    position: fixed;
    top: 30px;
    right: 90px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    /* display: none; */
}

.light-theme .admin-icon {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.admin-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.light-theme .admin-icon:hover {
    background: rgba(0, 0, 0, 0.1);
}

.admin-icon svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

.light-theme .admin-icon svg {
    fill: #1a1a1a;
}

.profile-section {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeIn 0.8s ease;
}

.profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.profile-name {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.profile-bio {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

.light-theme .profile-bio {
    color: rgba(0, 0, 0, 0.6);
}

.links-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    animation: fadeIn 0.8s ease 0.2s backwards;
}

.links-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 640px) {
    .links-container {
        grid-template-columns: 1fr;
    }
}

.link-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    text-decoration: none;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

.light-theme .link-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.link-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.15) 0%,
        rgba(118, 75, 162, 0.15) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.light-theme .link-card::before {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.1) 0%,
        rgba(118, 75, 162, 0.1) 100%
    );
}

.link-card::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 70%
    );
    border-radius: 50%;
    transition: transform 0.6s ease;
}

.link-card:hover::after {
    transform: translate(-50%, -50%) scale(2);
}

.link-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.light-theme .link-card:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.link-card:hover::before {
    opacity: 1;
}

.link-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.light-theme .link-icon {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
}

.link-card:hover .link-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

.link-icon svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2;
}

.link-icon i {
    font-size: 24px;
    color: #ffffff;
}

.link-title {
    font-size: 17px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.link-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 1;
    font-weight: 400;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.4s ease-out,
        opacity 0.4s ease-out;
}

.light-theme .link-description {
    color: rgba(0, 0, 0, 0.5);
}

.link-card:hover .link-description {
    max-height: 50px; /* Approximate height for 2 lines of text */
    opacity: 1;
    margin-top: 8px; /* Add some space when visible */
}

.links-container.list-view .link-card {
    flex-direction: row;
    text-align: left;
    padding: 20px 24px;
    min-height: auto;
    gap: 20px;
}

.links-container.list-view .link-card .link-icon {
    margin-bottom: 0;
    flex-shrink: 0;
}

.links-container.list-view .link-card .link-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.links-container.list-view .link-card .link-title {
    margin-bottom: 4px;
}

.links-container.list-view .link-card .link-description {
    max-height: none;
    opacity: 0.7;
    margin-top: 0;
}

.links-container.list-view .link-card:hover .link-description {
    opacity: 1;
    margin-top: 0;
}

.links-container.list-view .link-card:hover {
    transform: translateX(8px);
}

.link-arrow {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
    display: none;
}

.link-card:hover .link-arrow {
    transform: translateX(4px);
}

/* Admin Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.light-theme .modal-overlay {
    background: rgba(255, 255, 255, 0.7);
}

.modal {
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.4s ease;
}

.light-theme .modal {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

.light-theme .modal-title {
    color: #1a1a1a;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.light-theme .input-label {
    color: rgba(0, 0, 0, 0.6);
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    font-family: "Inter", sans-serif;
    transition: all 0.3s ease;
}

.light-theme .input-field {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.light-theme .input-field:focus {
    background: rgba(0, 0, 0, 0.06);
    border-color: #667eea;
}

.button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Inter", sans-serif;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.1);
    margin-top: 12px;
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

/* Admin Panel */
.admin-panel {
    display: none;
    animation: fadeIn 0.5s ease;
}

.admin-panel.active {
    display: block;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.admin-title {
    font-size: 28px;
    font-weight: 600;
}

.exit-button {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Inter", sans-serif;
}

.exit-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.admin-form {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
}

.light-theme .admin-form {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.form-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

.light-theme .form-title {
    color: #1a1a1a;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.light-theme .link-item {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.link-info {
    flex: 1;
}

.link-item-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.link-item-url {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    word-break: break-all;
}

.light-theme .link-item-url {
    color: rgba(0, 0, 0, 0.4);
}

.link-actions {
    display: flex;
    gap: 8px;
}

.icon-button {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.icon-button.delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

.icon-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.light-theme .icon-tabs {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.icon-tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.light-theme .icon-tab {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.6);
}

.icon-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.light-theme .icon-tab:hover {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.9);
}

.icon-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #ffffff;
}

.light-theme .icon-tab.active {
    color: #ffffff;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.icon-grid-item {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.light-theme .icon-grid-item {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.icon-grid-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.light-theme .icon-grid-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.icon-grid-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.2);
}

.icon-grid-item svg {
    width: 28px;
    height: 28px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2;
}

.light-theme .icon-grid-item svg {
    stroke: #1a1a1a;
}

.icon-grid-item i {
    font-size: 28px;
    color: #ffffff;
}

.light-theme .icon-grid-item i {
    color: #1a1a1a;
}

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

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

@media (max-width: 768px) {
    .container {
        padding: 30px 16px;
    }

    .view-toggle {
        top: 20px;
        right: 132px;
        width: 40px;
        height: 40px;
    }

    .theme-toggle {
        top: 20px;
        right: 76px;
        width: 40px;
        height: 40px;
    }

    .admin-icon {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    .modal {
        padding: 30px 24px;
    }

    .admin-form {
        padding: 24px;
    }

    .links-container {
        gap: 16px;
    }
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        var(--bg-primary) 0%,
        var(--bg-secondary) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    transition:
        opacity 0.5s ease,
        visibility 0.5s ease;
}

.loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--primary);
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-right-color: var(--primary-light);
    animation-delay: 0.15s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-bottom-color: var(--primary-dark);
    animation-delay: 0.3s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-600);
    letter-spacing: -0.3px;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        var(--primary) 0%,
        var(--primary-light) 50%,
        var(--primary) 100%
    );
    background-size: 200% 100%;
    border-radius: 2px;
    animation:
        loading-progress 2s ease-out forwards,
        shimmer 1.5s linear infinite;
}

@keyframes loading-progress {
    0% {
        width: 0%;
    }
    20% {
        width: 20%;
    }
    50% {
        width: 60%;
    }
    80% {
        width: 85%;
    }
    100% {
        width: 95%;
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dark mode support for loading overlay */
[data-theme="dark"] .loading-overlay {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="dark"] .loading-text {
    color: var(--gray-400);
}
