:root {
    --bg-primary: #e0e5ec;
    --bg-secondary: #d1d9e6;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --accent: #6c5ce7;
    --shadow-light: 5px 5px 10px #b8c1ec, -5px -5px 10px #ffffff;
    --shadow-inset: inset 5px 5px 10px #b8c1ec, inset -5px -5px 10px #ffffff;
    --shadow-button: 3px 3px 6px #b8c1ec, -3px -3px 6px #ffffff;
    --shadow-button-hover: 2px 2px 4px #b8c1ec, -2px -2px 4px #ffffff;
}

[data-theme="dark"] {
    --bg-primary: #2d3436;
    --bg-secondary: #1e272e;
    --text-primary: #dfe6e9;
    --text-secondary: #b2bec3;
    --accent: #a29bfe;
    --shadow-light: 5px 5px 10px #1a1a1a, -5px -5px 10px #3d3d3d;
    --shadow-inset: inset 5px 5px 10px #1a1a1a, inset -5px -5px 10px #3d3d3d;
    --shadow-button: 3px 3px 6px #1a1a1a, -3px -3px 6px #3d3d3d;
    --shadow-button-hover: 2px 2px 4px #1a1a1a, -2px -2px 4px #3d3d3d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-light);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.site-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1200px;
    z-index: 1000;
}

.main-content-index {
    padding-top: 120px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

.logo-image {
    height: 45px;
    width: auto;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: var(--shadow-button);
    transition: all 0.3s ease;
}

.logo-image:hover {
    box-shadow: var(--shadow-button-hover);
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-menu-toggle {
    display: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-primary);
    box-shadow: var(--shadow-button);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-2px);
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: var(--shadow-light);
    padding: 20px;
    z-index: 1000;
    transition: right 0.3s ease;
}

.mobile-sidebar.open {
    right: 0;
}

.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--bg-secondary);
}

.mobile-logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

.mobile-sidebar-close {
    display: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-primary);
    box-shadow: var(--shadow-button);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent);
    transition: all 0.3s ease;
}

.mobile-sidebar-close:hover {
    box-shadow: var(--shadow-button-hover);
}

.mobile-nav-links {
    list-style: none;
}

.mobile-nav-links li {
    margin-bottom: 15px;
}

.mobile-nav-links li a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 10px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-button);
    transition: all 0.3s ease;
    font-size: 18px;
}

.mobile-nav-links li a:hover,
.mobile-nav-links li a.active {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-button-hover);
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 10px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-button);
    transition: all 0.3s ease;
}

.nav-links li a.active {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-button-hover);
}

.nav-links li a:hover {
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-2px);
}

.theme-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-primary);
    box-shadow: var(--shadow-button);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-2px);
}

.sidebar {
    width: 250px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-light);
    border-radius: 20px;
    padding: 20px;
    position: fixed;
    height: calc(100vh - 40px);
    overflow-y: auto;
    box-sizing: border-box;
}

.sidebar-toggle {
    display: none;
}

.sidebar-toggle-btn {
    display: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-primary);
    box-shadow: var(--shadow-button);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent);
    transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-2px);
}

.sidebar h3 {
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-secondary);
    margin-top: 0;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin-bottom: 8px;
}

.sidebar ul li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 10px;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: var(--accent);
    color: white;
}

.main-content {
    margin-left: 270px;
}

.main-content-index {
    margin-left:0px;
}

.card {
    background: var(--bg-primary);
    box-shadow: var(--shadow-light);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-light);
}

.card h2 {
    color: var(--accent);
    margin-bottom: 15px;
}

.card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.post-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-button);
}

.btn-secondary:hover {
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-2px);
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    box-shadow: var(--shadow-light);
    margin: 20px auto;
    display: block;
    object-fit: cover;
}

.profile-section {
    text-align: center;
}

.profile-section h1 {
    color: var(--accent);
    margin-bottom: 10px;
}

.profile-section p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-links a {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-primary);
    box-shadow: var(--shadow-button);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 20px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-button-hover);
}

.social-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-primary);
    box-shadow: var(--shadow-light);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 15px;
}

.project-card h3 {
    color: var(--accent);
    margin-bottom: 10px;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-inset);
    color: var(--text-primary);
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    box-shadow: var(--shadow-button);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--bg-secondary);
}

table th {
    color: var(--accent);
}

table tr:hover {
    background: var(--bg-secondary);
}

.edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    min-width: 44px;
    height: 44px;
}

.edit-btn:hover {
    background: var(--accent);
    color: white;
}

.delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ff6b6b;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    min-width: 44px;
    height: 44px;
}

.delete-btn:hover {
    background: #ff6b6b;
    color: white;
}

.table-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 40px;
    height: 40px;
}

.table-btn-edit {
    color: var(--accent);
    background: var(--bg-secondary);
}

.table-btn-edit:hover {
    background: var(--accent);
    color: white;
}

.table-btn-delete {
    color: #ff6b6b;
    background: var(--bg-secondary);
}

.table-btn-delete:hover {
    background: #ff6b6b;
    color: white;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-primary);
    box-shadow: var(--shadow-medium);
    border: none;
    color: var(--accent);
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-3px);
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-light);
    border-radius: 20px;
}

.login-container h2 {
    text-align: center;
    color: var(--accent);
    margin-bottom: 30px;
}

.login-container .btn {
    width: 100%;
}

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: #00b894;
    color: white;
}

.alert-error {
    background: #ff6b6b;
    color: white;
}

.contact-links {
    display: flex;
    gap: 50px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
}

.contact-icon {
    width: 100px;
    height: 120px;
    border-radius: 15px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-button);
    padding: 8px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.contact-item:hover .contact-icon {
    box-shadow: var(--shadow-button-hover);
}

footer {
    background: var(--bg-primary);
    box-shadow: var(--shadow-light);
    border-radius: 20px;
    padding: 25px;
    margin-top: 30px;
}

.footer-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-copyright p {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 8px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-button);
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-2px);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-light);
    border-radius: 15px;
    padding: 18px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-light);
}

.link-favicon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.link-favicon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.link-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
}

.link-name {
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-url {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-link {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
}

.table-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.table-link:visited {
    color: var(--accent);
}



.contact-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 10px;
    font-weight: 500;
}

.clickable-image {
    cursor: zoom-in;
}

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-modal.open {
    opacity: 1;
    visibility: visible;
}

.image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.image-modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.image-modal-content img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-modal.open .image-modal-content img {
    transform: scale(1);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    transition: all 0.3s ease;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        margin-bottom: 0;
        z-index: 1000;
        transition: right 0.3s ease;
    }

    .sidebar.open {
        right: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-toggle-btn {
        display: flex;
    }

    .mobile-sidebar-close {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
        overflow-x: auto;
    }
}
