:root {
    --primary-navy: #020c1b;
    --accent-gold: #d4af37;
    --soft-white: #f8f9fa;
    --text-dark: #2d3436;
    --glass: rgba(255, 255, 255, 0.85);
    --shadow: 0 20px 40px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--soft-white);
    color: var(--text-dark);
    scroll-behavior: smooth;
}

/* --- Navigation --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 8%;
    background: var(--glass);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-navy);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo span { color: var(--accent-gold); }

nav ul { display: flex; list-style: none; }
nav ul li { margin-left: 2rem; }
nav ul li a {
    text-decoration: none;
    color: var(--primary-navy);
    font-weight: 500;
    transition: 0.3s;
}
nav ul li a:hover { color: var(--accent-gold); }
.security-link { cursor: pointer; }

/* --- Hero Section --- */
.hero {
    height: 80vh;
    background: linear-gradient(135deg, rgba(2, 12, 27, 0.9), rgba(10, 25, 47, 0.8)), 
                url('https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&q=80&w=1600');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 1rem;
}

.hero-content h1 { font-size: 3.5rem; margin-bottom: 1rem; line-height: 1.2; }
.hero-content p { font-size: 1.2rem; margin-bottom: 2rem; opacity: 0.9; font-weight: 300; }

/* --- Library Controls --- */
.library-section { padding: 5rem 8%; }

.controls-container {
    max-width: 900px;
    margin: -100px auto 3rem;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    z-index: 10;
    position: relative;
}

#siteSearch {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    outline: none;
    transition: 0.3s;
}

#siteSearch:focus { border-color: var(--accent-gold); box-shadow: 0 0 10px rgba(197, 160, 89, 0.1); }

.filter-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 18px;
    border: none;
    background: #f1f1f1;
    color: var(--text-dark);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary-navy);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.controls-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.add-btn {
    background: var(--primary-navy);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.add-btn:hover { 
    background: var(--accent-gold); 
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(197, 160, 89, 0.3);
}

/* Modal */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.6); 
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    position: relative;
}
.close-modal {
    position: absolute; top: 15px; right: 20px; font-size: 1.5rem; cursor: pointer;
}

/* --- Project Grid --- */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: 0.4s;
    border: 1px solid #eee;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.card-preview {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.delete-card {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #ff4757;
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0; transition: 0.3s;
}
.card:hover .delete-card { opacity: 1; }

.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent-gold);
    color: white;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
}

.card-content { padding: 1.5rem; }
.card-content h3 { font-size: 1.25rem; margin-bottom: 0.5rem; color: var(--primary-navy); }
.card-content p { font-size: 0.9rem; color: #666; margin-bottom: 1.5rem; }

.btn-link {
    text-decoration: none;
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}
.btn-link:hover { border-bottom: 2px solid var(--accent-gold); }

.card-actions {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    margin-top: 1rem;
}
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}
.action-btn:hover { 
    color: var(--accent-gold); 
    transform: scale(1.15);
}

/* --- About Section --- */
.about-section {
    background: var(--primary-navy);
    color: white;
    padding: 6rem 8%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
}

.about-text h2 { font-size: 2.5rem; margin-bottom: 1.5rem; }
.about-text span { color: var(--accent-gold); }
.about-text p { font-weight: 300; line-height: 1.8; opacity: 0.8; }

/* --- Testimonials Section --- */
.testimonials-section {
    padding: 6rem 8%;
    background: #fff;
    text-align: center;
}
.testimonials-section h2 { font-size: 2.5rem; margin-bottom: 3rem; color: var(--primary-navy); }
.testimonials-section span { color: var(--accent-gold); }

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: 0.3s;
    border-top: 4px solid var(--accent-gold);
}
.testimonial-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

.stars { color: #f1c40f; margin-bottom: 1rem; }
.testimonial-card p { font-style: italic; color: #555; margin-bottom: 1.5rem; line-height: 1.6; }
.testimonial-card h4 { color: var(--primary-navy); font-weight: 700; }


/* --- Contact Section --- */
.contact-section { padding: 6rem 8%; text-align: center; }
.contact-container { max-width: 600px; margin: 3rem auto 0; text-align: left; background: white; padding: 3rem; border-radius: 15px; box-shadow: var(--shadow); }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group textarea {
    width: 100%; padding: 1rem; border: 1px solid #ddd; border-radius: 8px; outline: none;
}

.btn-main {
    width: 100%; background: var(--accent-gold); color: white; padding: 1rem; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-main:hover { 
    background: #ae8a46; 
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.3);
}

footer { background: #050c16; color: white; padding: 3rem; text-align: center; font-size: 0.9rem; opacity: 0.7; }

/* --- Back to Top Button --- */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--accent-gold);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transition: 0.4s;
    z-index: 900;
}
#backToTop.active { opacity: 1; pointer-events: all; }
#backToTop:hover { transform: translateY(-5px); background: #b59030; }

/* --- Scroll Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active { opacity: 1; transform: translateY(0); }

/* Status Section (Hidden) */
#status-section {
    display: none; /* Hidden by default */
    background: #f0f2f5;
    padding: 4rem 8%;
}

/* Toast */
#toast { visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center; border-radius: 8px; padding: 16px; position: fixed; z-index: 3000; left: 50%; bottom: 30px; transform: translateX(-50%); }
#toast.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }
@keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }

/* Share Modal Grid */
.share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}
.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 1px solid #eee;
}
.share-option:hover { background: #e9ecef; transform: translateY(-2px); }
.share-icon { font-size: 1.5rem; }
.share-label { font-size: 0.8rem; font-weight: 500; }

/* Comment Styles */
.comment-list { max-height: 400px; overflow-y: auto; margin-bottom: 1rem; text-align: left; }
.comment-item { background: #f8f9fa; padding: 1rem; border-radius: 8px; margin-bottom: 10px; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.8rem; color: #666; }
.comment-body { margin-bottom: 0.5rem; white-space: pre-wrap; }
.comment-actions { display: flex; gap: 15px; font-size: 0.85rem; align-items: center; }
.action-link { cursor: pointer; color: var(--primary-navy); font-weight: 600; border: none; background: none; padding: 0; transition: 0.2s; }
.action-link:hover { text-decoration: underline; }
.action-link.delete { color: #ff4757; }
.reply-container { margin-left: 20px; border-left: 2px solid #ddd; padding-left: 10px; margin-top: 10px; }
.reply-input-box { margin-top: 10px; display: none; }
.edit-textarea { width: 100%; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 0.5rem; }

/* Mobile Adjustments */
@media (max-width: 768px) {
    .about-section { grid-template-columns: 1fr; text-align: center; }
    .hero-content h1 { font-size: 2.5rem; }
    nav ul { display: none; }
}