/* ============================================================
   Midnight Design System — single stylesheet for the whole site
   Deep navy-black background, off-white text, one cyan accent.
   ============================================================ */

:root {
    --background: 222 47% 6%;
    --foreground: 210 40% 96%;
    --card: 222 47% 9%;
    --card-foreground: 210 40% 96%;
    --primary: 199 89% 48%;
    --primary-foreground: 222 47% 6%;
    --secondary: 217 33% 14%;
    --secondary-foreground: 210 40% 96%;
    --muted: 217 33% 14%;
    --muted-foreground: 215 20% 55%;
    --accent: 217 33% 17%;
    --destructive: 0 72% 51%;
    --destructive-foreground: 210 40% 98%;
    --border: 217 33% 17%;
    --input: 217 33% 17%;
    --ring: 199 89% 48%;
    --success: 142 71% 45%;
    --warning: 38 92% 50%;
    --radius: 0.5rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: hsl(var(--primary));
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

h1, h2, h3, h4 {
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.muted {
    color: hsl(var(--muted-foreground));
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Thin scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--border)) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--accent));
}

/* Decorative floating shapes are not part of Midnight — keep markup, hide visually */
.floating-elements {
    display: none;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.5rem;
    padding: 0 1.25rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, color .15s, border-color .15s;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
    background: hsl(var(--primary) / 0.9);
}

.btn-secondary,
.btn-outline {
    background: transparent;
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}

.btn-secondary:hover,
.btn-outline:hover {
    background: hsl(var(--accent));
}

.btn-ghost {
    background: transparent;
    color: hsl(var(--foreground));
}

.btn-ghost:hover {
    background: hsl(var(--accent));
}

.btn-danger {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

/* ============================================================
   Navbar (top-nav variant)
   ============================================================ */
.cyber-nav {
    background: hsl(var(--card) / 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid hsl(var(--border));
    padding: 0.6rem 1.5rem;
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 1000px;
    border-radius: var(--radius);
    z-index: 1000;
    transition: background-color 0.2s ease;
}

.cyber-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0;
    max-width: none;
}

.logo-link:hover {
    text-decoration: none;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: block;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.75rem;
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: color 0.15s ease;
}

.mobile-menu-toggle:hover {
    color: hsl(var(--primary));
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    color: hsl(var(--sidebar-foreground, var(--foreground)));
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    background: hsl(var(--accent));
    color: hsl(var(--foreground));
    text-decoration: none;
}

.nav-link.active {
    background: hsl(var(--primary) / 0.15);
    color: hsl(var(--primary));
}

/* ============================================================
   Hero
   ============================================================ */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    text-align: center;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: hsl(var(--foreground));
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.highlight {
    color: hsl(var(--primary));
}

.hero-subtitle {
    font-size: 1.35rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   Section headers
   ============================================================ */
.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: hsl(var(--foreground));
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.05rem;
    color: hsl(var(--muted-foreground));
    font-weight: 400;
}

/* ============================================================
   About
   ============================================================ */
.cyber-about {
    padding: 96px 0;
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: hsl(var(--foreground));
    margin-bottom: 1.5rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.image-container {
    position: relative;
    display: inline-block;
}

.about-image img {
    width: 250px;
    height: 250px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 1px solid hsl(var(--border));
}

/* ============================================================
   Skills
   ============================================================ */
.cyber-progress {
    padding: 96px 0;
    background: hsl(var(--card) / 0.4);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background: hsl(var(--card));
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid hsl(var(--border));
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.skill-card:hover {
    border-color: hsl(var(--primary) / 0.5);
    background: hsl(var(--accent) / 0.5);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: hsl(var(--primary));
}

.skill-card h4 {
    font-size: 1.05rem;
    color: hsl(var(--foreground));
}

/* ============================================================
   Testimonials
   ============================================================ */
.cyber-testimonials {
    padding: 96px 0;
}

.testimonial-slider {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.testimonial-card {
    background: hsl(var(--card));
    padding: 2.5rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid hsl(var(--border));
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
}

.quote-icon {
    font-size: 2.5rem;
    color: hsl(var(--primary));
    margin-bottom: 1.5rem;
}

.testimonial-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: hsl(var(--foreground));
}

.testimonial-author strong {
    color: hsl(var(--primary));
    font-size: 1rem;
    display: block;
}

.testimonial-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.testimonial-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    border: 1px solid hsl(var(--primary));
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.testimonial-dot.active {
    background: hsl(var(--primary));
}

.testimonial-dot:hover {
    background: hsl(var(--primary) / 0.5);
}

/* ============================================================
   Contact (home CTA cards)
   ============================================================ */
.cyber-contact {
    padding: 96px 0;
    background: hsl(var(--card) / 0.4);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    background: hsl(var(--card));
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid hsl(var(--border));
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.contact-card:hover {
    border-color: hsl(var(--primary) / 0.5);
    background: hsl(var(--accent) / 0.5);
}

.contact-icon {
    font-size: 2.25rem;
    color: hsl(var(--primary));
    margin-bottom: 0.75rem;
}

.contact-card h4 {
    margin-bottom: 1.25rem;
    color: hsl(var(--foreground));
    font-size: 1.05rem;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    padding: 0 1.25rem;
    height: 2.5rem;
    border-radius: calc(var(--radius) - 2px);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-contact:hover {
    background: hsl(var(--primary) / 0.9);
    text-decoration: none;
}

/* ============================================================
   Contact form page
   ============================================================ */
.contact-form-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
}

.contact-form-container {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    background: hsl(var(--card));
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    color: hsl(var(--foreground));
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid hsl(var(--input));
    border-radius: calc(var(--radius) - 2px);
    background: hsl(var(--secondary) / 0.5);
    color: hsl(var(--foreground));
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: hsl(var(--muted-foreground));
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.4);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
    height: auto;
    padding: 0.5rem 0.75rem;
    line-height: 1.6;
}

.form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 0.5rem;
}

.success-message,
.error-message {
    text-align: center;
    padding: 2.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.success-message {
    background: hsl(var(--success) / 0.1);
    border-color: hsl(var(--success) / 0.3);
    color: hsl(var(--success));
}

.error-message {
    background: hsl(var(--destructive) / 0.1);
    border-color: hsl(var(--destructive) / 0.3);
    color: hsl(var(--destructive));
}

.success-message i,
.error-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.success-message h3 {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.success-message p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* ============================================================
   Footer
   ============================================================ */
.cyber-footer {
    background: hsl(var(--card) / 0.6);
    padding: 2rem 0;
    border-top: 1px solid hsl(var(--border));
}

.footer-content {
    text-align: center;
}

.copyright {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* ============================================================
   Projects
   ============================================================ */
.cyber-projects {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

.project-card {
    background: hsl(var(--card));
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    transition: border-color 0.15s ease;
}

.project-card:hover {
    border-color: hsl(var(--primary) / 0.5);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.project-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0;
    line-height: 1.3;
}

.project-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    flex-shrink: 0;
}

.project-badge,
.visibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.project-badge.maintained,
.visibility-badge.public {
    background: hsl(var(--success) / 0.2);
    color: hsl(var(--success));
}

.project-badge.not-maintained {
    background: hsl(var(--warning) / 0.2);
    color: hsl(var(--warning));
}

.visibility-badge.private {
    background: hsl(var(--destructive) / 0.2);
    color: hsl(var(--destructive));
}

.project-badge i,
.visibility-badge i {
    font-size: 0.9rem;
}

.project-description {
    color: hsl(var(--muted-foreground));
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.project-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: hsl(var(--primary) / 0.15);
    color: hsl(var(--primary));
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: 2.25rem;
    background: transparent;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    text-decoration: none;
    border-radius: calc(var(--radius) - 2px);
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
}

.project-link:hover {
    background: hsl(var(--accent));
    text-decoration: none;
}

.project-link.demo {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: transparent;
}

.project-link.demo:hover {
    background: hsl(var(--primary) / 0.9);
}

.project-link i {
    font-size: 1rem;
}

/* ============================================================
   Image viewer (view.php)
   ============================================================ */
.view-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.view-container {
    width: 100%;
    max-width: 1000px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.image-preview {
    width: 100%;
    background: hsl(var(--background) / 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 300px;
    border-bottom: 1px solid hsl(var(--border));
}

.image-preview img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: calc(var(--radius) - 2px);
    object-fit: contain;
}

.info-panel {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.9rem;
}

.stat-item strong {
    color: hsl(var(--foreground));
    font-weight: 500;
}

.stat-item i {
    color: hsl(var(--primary));
    font-size: 1.1rem;
}

.actions {
    display: flex;
    gap: 0.75rem;
}

.file-icon {
    font-size: 5rem;
    color: hsl(var(--primary));
}

/* ============================================================
   Error page (error.php)
   ============================================================ */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-container {
    text-align: center;
    max-width: 560px;
    padding: 3rem;
    margin: 2rem;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
}

.error-icon {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    color: hsl(var(--primary));
}

.error-container.type-404 .error-icon {
    color: hsl(var(--destructive));
}

.error-container.type-403 .error-icon {
    color: hsl(var(--warning));
}

.error-container.type-maintenance .error-icon {
    color: hsl(var(--primary));
}

.error-title {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: hsl(var(--foreground));
    letter-spacing: -0.02em;
}

.error-message-text {
    font-size: 1.1rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 2rem;
    line-height: 1.7;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

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

    .nav-list {
        display: none;
        flex-direction: column;
        gap: 0.25rem;
        width: 100%;
        text-align: center;
        padding-top: 0.75rem;
        padding-bottom: 0.25rem;
    }

    .nav-list.active {
        display: flex;
    }

    .cyber-nav .container {
        flex-wrap: wrap;
    }

    .skills-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .contact-form-container {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-buttons {
        flex-direction: column;
    }

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

    .project-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-badges {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .info-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .actions {
        width: 100%;
    }

    .actions .btn {
        flex: 1;
    }

    .error-container {
        padding: 2rem 1.5rem;
    }

    .error-title {
        font-size: 1.75rem;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }

    .error-actions .btn {
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .form-buttons .btn {
        width: 100%;
    }

    .project-badges {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-links {
        flex-direction: column;
    }

    .project-link {
        justify-content: center;
    }
}
