/* 
 * Dark Theme CSS - Complete Site Styling
 * For Adam Thompson Portfolio Site
 */

/* ========================================
   1. CSS Variables & Root Styles
   ======================================== */
:root {
    --bg-dark: #000000;
    --bg-blue: #001a3d;
    --text-light: #ffffff;
    --text-dim: #a0a0a0;
    --folder-color: #4a6fa5;
    --folder-hover: #5a7fb5;
    --folder-dark: #3a5a8a;
    --accent: #4a90e2;
    --header-footer-bg: #000000;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-hover: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.1);
}

/* ========================================
   2. Base Styles & Typography
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-light);
    background: #000000;
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.2;
    color: var(--text-light);
}

p {
    color: var(--text-dim);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   3. Background & Layout
   ======================================== */
/*
Gradient background if I want to switch back from using image
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-blue) 50%, var(--bg-dark) 100%);
    z-index: -1;
}

.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(74, 144, 226, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 26, 61, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(42, 63, 95, 0.2) 0%, transparent 70%);
}*/

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/new_school.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -1;
}

.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 26, 61, 0.8) 50%, rgba(0, 0, 0, 0.7) 100%);
}

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 30px;
}

.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: 2rem;
}

/* Projects/Ramblings specific layout for fixed viewport */
.projects-page body,
.ramblings-page body {
    height: 100vh;
    overflow: hidden;
}

.projects-page .main-container,
.ramblings-page .main-container {
    height: 100vh;
}

.projects-page .content,
.ramblings-page .content {
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100vh - 16vh); /* Subtract header and footer heights */
}

/* Ensure mobile still works normally */
@media (max-width: 768px) {
    .projects-page body,
    .ramblings-page body {
        height: auto;
        overflow: visible;
    }
    
    .projects-page .main-container,
    .ramblings-page .main-container {
        height: auto;
    }
    
    .projects-page .content,
    .ramblings-page .content {
        overflow: visible;
        height: auto;
    }
}

/* Home page specific container */
.home-page body {
    height: 100vh;
    overflow: hidden;
}

.home-page .main-container {
    height: 100vh;
}

.home-page .content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ========================================
   4. Header Styles
   ======================================== */
.header {
    background-color: var(--header-footer-bg);
    color: var(--text-light);
    padding: 1rem 0;
    flex-shrink: 0;
    height: 8vh;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
}

.logo a {
    color: var(--text-light);
    position: relative;
    display: inline-block;
}

.logo a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text-light);
    transition: width 0.3s ease;
}

.logo a:hover::after {
    width: 100%;
}

.nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav a {
    color: var(--text-light);
    position: relative;
    font-size: 1rem;
    transition: opacity 0.3s ease;
    display: inline-block;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text-light);
    transition: width 0.3s ease;
}

.nav a:hover::after {
    width: 100%;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
}

.mobile-toggle span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: var(--text-light);
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: all 0.3s ease;
}

.mobile-toggle span:nth-child(1) { top: 0; }
.mobile-toggle span:nth-child(2) { top: 9px; }
.mobile-toggle span:nth-child(3) { top: 18px; }

.mobile-toggle.active span:nth-child(1) {
    top: 9px;
    transform: rotate(135deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.mobile-toggle.active span:nth-child(3) {
    top: 9px;
    transform: rotate(-135deg);
}

/* ========================================
   5. Footer Styles
   ======================================== */
.footer {
    background-color: var(--header-footer-bg);
    color: var(--text-light);
    padding: 1rem 0;
    flex-shrink: 0;
    height: 8vh;
    display: flex;
    align-items: center;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.footer-bottom {
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-link {
    font-size: 0.85rem;
    color: var(--text-dim);
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--text-light);
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    color: var(--text-light);
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.footer-social a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text-light);
    transition: width 0.3s ease;
}

.footer-social a:hover::after {
    width: 100%;
}

.footer-social a:hover {
    opacity: 0.8;
}

.footer-social svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Admin trigger (hidden dot) */
#admin-trigger {
    cursor: pointer;
    opacity: 0.1;
}

/* ========================================
   6. Home Page Specific Styles
   ======================================== */
.about-section {
    margin-bottom: 1rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.about-text {
    flex: 1;
}

.about-section h1 {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    text-align: left;
}

.about-section p {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    text-align: justify;
}

.profile-photo {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: 2.2rem;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Folders */
.folders-container {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    padding: 1rem 0;
}

.folder-item {
    position: relative;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.folder-svg {
    width: 180px;
    height: 180px;
    position: relative;
    filter: drop-shadow(8px 8px 15px rgba(0, 0, 0, 0.5));
}

.folder-structure {
    position: relative;
    width: 100%;
    height: 100%;
}

.folder-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.spring-icons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}

.folder-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.folder-closed, .folder-open {
    transition: opacity 0.3s ease;
}

.folder-closed { opacity: 1; }
.folder-open { opacity: 0; }

.folder-item:hover .folder-closed { opacity: 0; }
.folder-item:hover .folder-open { opacity: 1; }

.spring-icon {
    position: absolute;
    opacity: 0;
    font-size: 2.5rem;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translate(0, 20px);
}

.folder-item:hover .spring-icon {
    opacity: 1;
}

.folder-item:hover .spring-icon:nth-child(1) {
    transform: translate(-60px, -80px) rotate(-15deg);
}

.folder-item:hover .spring-icon:nth-child(2) {
    transform: translate(60px, -80px) rotate(15deg);
}

.folder-item:hover .spring-icon:nth-child(3) {
    transform: translate(0, -100px) rotate(0deg);
}

.folder-label {
    text-align: center;
    margin-top: 0.8rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    color: var(--text-dim);
    position: relative;
    display: inline-block;
}

.folder-label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text-dim);
    transition: width 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.folder-item:hover .folder-label::after {
    width: 100%;
}

.contact-section {
    text-align: center;
    padding: 1.5rem 0 2rem;
    color: var(--text-dim);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.contact-section a {
    color: var(--text-light);
    position: relative;
    display: inline-block;
}

.contact-section a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text-light);
    transition: width 0.3s ease;
}

.contact-section a:hover::after {
    width: 100%;
}

/* ========================================
   7. Projects/Ramblings Page Styles
   ======================================== */
.page-header {
    text-align: center;
    padding: 3rem 0;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto;
}

/* Search and Filter */
.search-container {
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--card-hover);
}

.search-input::placeholder {
    color: var(--text-dim);
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 25px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--text-light);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-light);
}

/* Grid Layout */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.item-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.item-thumbnail {
    width: 100%;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-card:hover .item-thumbnail {
    background: rgba(255, 255, 255, 0.15);
}

.item-info {
    padding: 1rem 0;
}

.item-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-size: 0.75rem;
    color: var(--text-dim);
    background: var(--card-bg);
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    border: 1px solid var(--border-light);
}

/* Admin Controls */
.btn-new-item {
    display: block;
    margin: 2rem auto;
    padding: 1rem 2rem;
    background: var(--accent);
    color: var(--text-light);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-new-item:hover {
    background: var(--folder-hover);
    transform: translateY(-2px);
}

.item-edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
}

.item-card:hover .item-edit-btn {
    opacity: 0.9;
}

.item-edit-btn:hover {
    background: var(--accent);
    transform: scale(1.1);
}

/* No items message */
.no-items {
    text-align: center;
    padding: 5rem 0;
    color: var(--text-dim);
}

/* ========================================
   8. Project/Post Detail Page Styles
   ======================================== */
.detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 0;
}

.detail-header {
    margin-bottom: 3rem;
    text-align: center;
}

.detail-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.detail-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.detail-tags {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.detail-image {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 3rem;
    border-radius: 10px;
    overflow: hidden;
}

.detail-image img {
    width: 100%;
    height: auto;
}

.detail-content {
    color: var(--text-dim);
    line-height: 1.8;
    font-size: 1rem;
}

.detail-content h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--text-light);
}

.detail-content h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-light);
}

.detail-content p {
    margin-bottom: 1.5rem;
}

.detail-content ul, .detail-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.detail-content img {
    margin: 2rem 0;
    border-radius: 10px;
}

.detail-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.detail-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    transition: color 0.3s ease;
}

.detail-nav a:hover {
    color: var(--text-light);
}

/* ========================================
   9. Admin Modal Styles
   ======================================== */
.admin-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
}

.admin-modal-content {
    background-color: #1a1a1a;
    margin: 5vh auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-light);
}

.admin-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-dim);
    transition: color 0.3s ease;
}

.admin-modal-close:hover {
    color: var(--text-light);
}

.admin-modal h3 {
    margin-bottom: 20px;
    color: var(--text-light);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 500;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    color: var(--text-light);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

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

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.submit-btn {
    padding: 12px 30px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: var(--folder-hover);
    transform: translateY(-2px);
}

.delete-btn {
    padding: 12px 30px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #b71c1c;
}

.admin-mode-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 999;
}

.admin-mode-indicator button {
    background: none;
    border: none;
    color: white;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
}

/* ========================================
   10. Responsive Styles
   ======================================== */
@media (max-width: 768px) {
    .header, .footer {
        height: auto;
        min-height: 60px;
    }

    .mobile-toggle {
        display: block;
    }

    .nav {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--header-footer-bg);
        transition: right 0.3s ease;
        z-index: 1000;
    }

    .nav.active {
        right: 0;
    }

    .nav ul {
        flex-direction: column;
        padding: 2rem;
        height: 100%;
        justify-content: center;
    }

    .about-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .about-text {
        text-align: left;
    }

    .profile-photo {
        margin-top: 0;
    }

    .folders-container {
        flex-direction: column;
        gap: 2rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1.5rem;
    }

    .detail-title {
        font-size: 2rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-left {
        align-items: center;
    }
}

@media (max-width: 500px) {
    .home-page body {
        overflow-y: auto;
    }

    .home-page .main-container {
        height: auto;
        min-height: 100vh;
    }

    .content {
        padding: 1rem;
    }

    .about-section h1 {
        font-size: 1.5rem;
    }

    .about-section p {
        font-size: 0.9rem;
        text-align: left;
    }

    .profile-photo {
        display: none;
    }

    .folder-svg {
        width: 150px;
        height: 150px;
    }

    .spring-icon {
        font-size: 2rem;
    }

    .folder-item:hover .spring-icon:nth-child(1) {
        transform: translate(-40px, -60px) rotate(-15deg);
    }

    .folder-item:hover .spring-icon:nth-child(2) {
        transform: translate(40px, -60px) rotate(15deg);
    }

    .folder-item:hover .spring-icon:nth-child(3) {
        transform: translate(0, -70px) rotate(0deg);
    }

    .item-thumbnail {
        height: 120px;
    }

    .detail-container {
        padding: 2rem 0;
    }

    .detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}