/* assets/css/style.css */

/* 主题1: 极光紫蓝 (默认) */
:root, [data-theme="aurora"] {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #f472b6;
    --accent-light: #f9a8d4;
    --bg-start: #0f0c29;
    --bg-mid: #302b63;
    --bg-end: #24243e;
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.12);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --modal-bg: rgba(30, 27, 75, 0.95);
}

/* 主题2: 海洋蓝绿 */
[data-theme="ocean"] {
    --primary: #64ffda;
    --primary-light: #a7ffeb;
    --primary-dark: #14b8a6;
    --accent: #7dd3fc;
    --accent-light: #bae6fd;
    --bg-start: #0a192f;
    --bg-mid: #112240;
    --bg-end: #1a365d;
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(100, 255, 218, 0.15);
    --text-main: #ccd6f6;
    --text-muted: #8892b0;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(100, 255, 218, 0.1);
    --modal-bg: rgba(10, 25, 47, 0.95);
}

/* 主题3: 暖色日落 */
[data-theme="sunset"] {
    --primary: #ff6b6b;
    --primary-light: #ffa8a8;
    --primary-dark: #ee5a5a;
    --accent: #feca57;
    --accent-light: #fed87a;
    --bg-start: #1a1423;
    --bg-mid: #2d1b3d;
    --bg-end: #4a1942;
    --card-bg: rgba(255, 255, 255, 0.07);
    --card-border: rgba(255, 107, 107, 0.15);
    --text-main: #ffeef0;
    --text-muted: #c9a8ab;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 107, 107, 0.12);
    --modal-bg: rgba(45, 27, 61, 0.95);
}

/* 主题4: 森林绿 */
[data-theme="forest"] {
    --primary: #38ef7d;
    --primary-light: #6ff7a3;
    --primary-dark: #11998e;
    --accent: #11998e;
    --accent-light: #38c9b9;
    --bg-start: #0d1f22;
    --bg-mid: #1a3c34;
    --bg-end: #0f2027;
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(56, 239, 125, 0.15);
    --text-main: #e0f2e9;
    --text-muted: #8fb8a8;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(56, 239, 125, 0.1);
    --modal-bg: rgba(13, 31, 34, 0.95);
}

/* 主题5: 玫瑰金 */
[data-theme="rose"] {
    --primary: #f093fb;
    --primary-light: #f5b6fc;
    --primary-dark: #c471ed;
    --accent: #f5576c;
    --accent-light: #f8838f;
    --bg-start: #1f1c2c;
    --bg-mid: #2c2137;
    --bg-end: #3a2a3f;
    --card-bg: rgba(255, 255, 255, 0.07);
    --card-border: rgba(240, 147, 251, 0.15);
    --text-main: #fdf2f8;
    --text-muted: #d4a5c9;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(240, 147, 251, 0.12);
    --modal-bg: rgba(44, 33, 55, 0.95);
}

/* 主题6: 赛博霓虹 */
[data-theme="cyber"] {
    --primary: #00d4ff;
    --primary-light: #5ce1ff;
    --primary-dark: #00a8cc;
    --accent: #00ff88;
    --accent-light: #5cffaa;
    --bg-start: #0a0a0a;
    --bg-mid: #121212;
    --bg-end: #1a1a1a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(0, 212, 255, 0.2);
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(0, 212, 255, 0.15);
    --modal-bg: rgba(18, 18, 18, 0.95);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 50%, var(--bg-end) 100%);
    background-attachment: fixed;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* 动态背景光效 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(244, 114, 182, 0.12) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(129, 140, 248, 0.1) 0%, transparent 40%);
    animation: bgFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, 2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

/* 导航栏 - 毛玻璃效果 */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* 搜索框 */
.search-wrapper {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.search-input {
    border-radius: 50px;
    padding: 0.7rem 1rem 0.7rem 2.8rem;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.25);
    color: #ffffff;
    transition: all 0.3s ease;
    font-weight: 500;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    background: rgba(0, 0, 0, 0.35);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 0 20px rgba(99, 102, 241, 0.15);
    outline: none;
    color: #ffffff;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s;
}

.search-input:focus + .search-icon,
.search-wrapper:focus-within .search-icon {
    color: var(--primary-light);
}

/* 分类标题 */
.category-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1rem;
    position: relative;
}

.category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
}

/* 链接卡片 */
.link-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 1rem 1.2rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.1) 0%,
        rgba(244, 114, 182, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.link-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-light);
    box-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.3),
                0 0 0 1px rgba(99, 102, 241, 0.1);
    color: inherit;
}

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

.link-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-right: 1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px -3px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.link-card:hover .link-icon {
    transform: scale(1.1) rotate(-3deg);
    box-shadow: 0 8px 20px -3px rgba(99, 102, 241, 0.5);
}

.link-info {
    flex-grow: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.link-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.link-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 编辑模式下的操作按钮 */
.card-actions {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
    display: flex;
    gap: 0.3rem;
}

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

.btn-action {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--primary-light);
}

.btn-action.text-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* 登录页 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2a3a 0%, #2d4a5e 50%, #1e3a4c 100%);
    position: relative;
    overflow: hidden;
}

/* 背景装饰动画 */
.login-container::before, .login-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    z-index: 0;
}
.login-container::before {
    width: 300px;
    height: 300px;
    background: rgba(100, 180, 200, 0.08);
    top: -50px;
    left: -50px;
    animation: float 6s ease-in-out infinite;
}
.login-container::after {
    width: 250px;
    height: 250px;
    background: rgba(80, 160, 180, 0.1);
    bottom: -50px;
    right: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 1;
    position: relative;
}

.login-header {
    margin-bottom: 2rem;
    text-align: center;
}
.login-icon-box {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #3d5a6c 0%, #4a7c8a 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #fff;
    box-shadow: 0 10px 20px -5px rgba(74, 124, 138, 0.5);
    transform: rotate(-5deg);
    transition: transform 0.3s;
}
.login-card:hover .login-icon-box {
    transform: rotate(0deg) scale(1.05);
}

.form-control-login {
    border-radius: 12px;
    padding: 0.8rem 1rem 0.8rem 2.8rem; /* Left padding for icon */
    border: 2px solid #f3f4f6;
    background-color: #f9fafb;
    font-size: 1rem;
    transition: all 0.2s;
}
.form-control-login:focus {
    background-color: #fff;
    border-color: #8ec5fc;
    box-shadow: 0 0 0 4px rgba(142, 197, 252, 0.2);
}

.input-icon-wrapper {
    position: relative;
    margin-bottom: 1.2rem;
}
.input-icon-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 2;
    transition: color 0.2s;
}
.form-control-login:focus + i, 
.form-control-login:focus ~ i { /* Handle both structures */
    color: var(--primary-color);
}

.btn-login {
    border-radius: 12px;
    padding: 0.8rem;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #3d5a6c 0%, #2d4a5e 100%);
    border: none;
    color: white;
    width: 100%;
    margin-top: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(45, 74, 94, 0.5);
    color: white;
}

/* 模态框美化 */
.modal-content {
    background: var(--modal-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: var(--text-main);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--text-main);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.6;
}

.btn-close:hover {
    opacity: 1;
}
.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem;
}

/* 模态框内表单样式 */
.modal-content .form-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-content .form-control,
.modal-content .form-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    transition: all 0.2s ease;
}

.modal-content .form-control:focus,
.modal-content .form-select:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    color: var(--text-main);
}

.modal-content .form-control::placeholder {
    color: var(--text-muted);
}

.modal-content .form-text {
    color: var(--text-muted);
}

.modal-content .form-text a {
    color: var(--primary-light);
}

.modal-content .input-group-text {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
}

/* 浮动添加按钮 */
.fab-add {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.5);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    border: none;
}

.fab-add:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 35px -5px rgba(99, 102, 241, 0.6);
    color: white;
}

.fab-add:active {
    transform: scale(0.95);
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -5px rgba(99, 102, 241, 0.4);
}

.btn-light {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 10px;
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

/* 下拉菜单样式 */
.dropdown-menu {
    background: var(--modal-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
}

.dropdown-item {
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.dropdown-item.text-danger {
    color: #f87171;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.dropdown-divider {
    border-color: var(--glass-border);
}

/* 用户按钮 */
.navbar .btn-light {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    padding: 0;
}

.navbar .btn-light:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--primary-light);
}

/* 分类管理列表 */
.list-group {
    background: transparent;
}

.list-group-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    margin-bottom: 0.5rem;
    border-radius: 10px !important;
}

.list-group-item .btn-outline-secondary {
    border-color: var(--glass-border);
    color: var(--text-muted);
}

.list-group-item .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-light);
}

.list-group-item .btn-outline-danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.list-group-item .btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* 加载动画 */
.spinner-border {
    color: var(--primary-light) !important;
}

/* 主内容区域 */
#mainContent {
    position: relative;
    z-index: 1;
}

.category-section {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

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

/* 分类区块延迟动画 */
.category-section:nth-child(1) { animation-delay: 0.1s; }
.category-section:nth-child(2) { animation-delay: 0.2s; }
.category-section:nth-child(3) { animation-delay: 0.3s; }
.category-section:nth-child(4) { animation-delay: 0.4s; }
.category-section:nth-child(5) { animation-delay: 0.5s; }

/* 空状态提示 */
.text-muted {
    color: var(--text-muted) !important;
}

/* 警告提示框 */
.alert-warning {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .fab-add {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 54px;
        height: 54px;
    }

    .link-card {
        padding: 0.9rem 1rem;
    }

    .link-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

/* 主题切换器 */
.theme-switcher {
    position: relative;
    display: inline-block;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #818cf8;
    transform: rotate(30deg);
}

.theme-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: rgba(20, 20, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 140px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    /* 默认隐藏 - 使用display而非opacity */
    display: none;
}

/* 显示状态 - 通过JS添加show类 */
.theme-dropdown.show {
    display: block;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #f1f5f9;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.15);
}

.theme-option.active {
    background: rgba(99, 102, 241, 0.3);
}

.theme-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.theme-option span {
    font-size: 0.85rem;
    white-space: nowrap;
}

/* 自定义确认弹窗 */
.confirm-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.confirm-icon i {
    font-size: 1.8rem;
    color: #f87171;
}

.confirm-title {
    color: var(--text-main);
    font-weight: 600;
}

.confirm-message {
    font-size: 0.95rem;
}

#confirmModal .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    padding: 0.5rem 1.5rem;
}

#confirmModal .btn-danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    transform: translateY(-1px);
}
