:root {
    --accent-start: #4facfe;
    --accent-end: #00f2fe;
    --bg-dark: #0f1419;
    --bg-card: rgba(30, 35, 40, 0.7);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-scale: 1.02;
}

body {
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #0d1117 100%);
    background-attachment: fixed;
    transition: background 0.5s ease, color 0.5s ease;
}

body.light-mode {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 50%, #f0f2f5 100%);
}

body.light-mode #bg {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.08) 0%, rgba(0, 242, 254, 0.05) 100%);
}

body.light-mode #bg:before {
    background-image: linear-gradient(to top, rgba(245, 247, 250, 0.95), rgba(245, 247, 250, 0.95)), url("../../images/overlay.png");
    transition: background-color 0.8s ease, background-image 0.8s ease;
    transition-delay: 0s;
}

body.light-mode #bg:after {
    opacity: 0;
    transition: opacity 0.8s ease;
    filter: none;
}

body.light-mode.is-preload #bg:before {
    background-color: #ffffff;
}

body.light-mode,
body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    color: #1a1f2e;
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode h5,
body.light-mode h6 {
    color: #1a1f2e;
}

body.light-mode h2.major {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode a {
    color: #2563eb;
    border-bottom-color: rgba(37, 99, 235, 0.5);
}

body.light-mode a:hover {
    color: #1d4ed8;
}

body.light-mode #header {
    background: rgba(255, 255, 255, 0.85);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode nav ul li a {
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode nav ul li a:hover {
    color: #1a1f2e;
}

body.light-mode nav ul li a::after {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

body.light-mode #main article {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

body.light-mode #main article.active {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

body.light-mode .image.main {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.light-mode .image.main:hover {
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15);
}

body.light-mode .close {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

body.light-mode .card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .card:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

body.light-mode .card::before {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

body.light-mode .card-title {
    color: #1a1f2e;
}

body.light-mode .card-desc {
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .card-icon {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .back-to-home {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
}

body.light-mode .back-to-home:hover {
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.4);
}

body.light-mode .footer__link-item {
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .footer__link-item:hover {
    color: #1a1f2e;
}

body.light-mode ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2563eb, #3b82f6);
}

body.light-mode .button {
    border-color: #2563eb;
    color: #2563eb;
}

body.light-mode .button:hover {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
}

body.light-mode .button.primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
}

body.light-mode ul.alt li {
    border-top-color: rgba(0, 0, 0, 0.1);
}

body.light-mode input[type="text"],
body.light-mode input[type="password"],
body.light-mode input[type="email"],
body.light-mode input[type="tel"],
body.light-mode select,
body.light-mode textarea {
    border-color: rgba(0, 0, 0, 0.2);
    color: #1a1f2e;
}

body.light-mode input[type="text"]:focus,
body.light-mode input[type="password"]:focus,
body.light-mode input[type="email"]:focus,
body.light-mode input[type="tel"]:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
    background: rgba(0, 0, 0, 0.03);
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

body.light-mode label {
    color: #1a1f2e;
}

body.light-mode select option {
    color: #1a1f2e;
    background: #ffffff;
}

body.light-mode .box {
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode table {
    color: #1a1f2e;
}

body.light-mode table th {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode table tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.03);
}

body.light-mode .table-wrapper {
    border-color: rgba(0, 0, 0, 0.1);
}

#bg {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.05) 0%, rgba(0, 242, 254, 0.03) 100%);
    transition: background 0.5s ease;
}

body, input, select, textarea {
    color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

h2.major {
    border-bottom-color: var(--border-color);
}

a {
    color: var(--accent-start);
    border-bottom-color: rgba(79, 172, 254, 0.5);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-end);
    border-bottom-color: transparent;
}

#header {
    background: rgba(15, 20, 25, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
}

#header .logo {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#header .logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(79, 172, 254, 0.4);
}

nav ul li a {
    color: var(--text-secondary);
    border-bottom: none;
    position: relative;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--text-primary);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

#main article {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

#main article.active {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.image.main {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

.image.main:hover {
    box-shadow: 0 8px 30px rgba(79, 172, 254, 0.2);
}

.image.main img {
    border-radius: 12px;
    transition: transform 0.5s ease;
}

.image.main:hover img {
    transform: scale(1.03);
}

.close {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.close:hover {
    background: rgba(255, 80, 80, 0.2);
    color: #ff5050;
    transform: rotate(90deg);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(79, 172, 254, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

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

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s ease;
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.back-to-home {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.back-to-home:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 30px rgba(79, 172, 254, 0.6);
}

.footer__link-item {
    transition: all 0.3s ease;
}

.footer__link-item:hover {
    padding-left: 8px;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-start), var(--accent-end));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-end), var(--accent-start));
}

.button {
    background: transparent;
    border: 1px solid var(--accent-start);
    color: var(--accent-start);
    transition: all 0.3s ease;
    border-radius: 8px;
}

.button:hover {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: white;
    border-color: transparent;
}

.button.primary {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    border-color: transparent;
    color: white;
}

.button.primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.4);
}

ul.alt li {
    border-top-color: var(--border-color);
}

.theme-toggle {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.theme-toggle:hover {
    transform: translateY(-5px) scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

body.light-mode .theme-toggle {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1f2e;
}

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

@media screen and (max-width: 736px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .back-to-home {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .theme-toggle {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        left: 1.5rem;
    }

    #header {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}