/* ============================================
   Main Stylesheet - The World of Computing According to Dave
   Color Scheme: #4b3190 (purple), #fdbb30 (yellow/gold), white, black
   ============================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4b3190;
    --accent-color: #fdbb30;
    --text-color: #000000;
    --bg-color: #ffffff;
    --light-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --code-bg: #f8f8f8;
    --code-border: #ddd;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

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

/* Header Styles */
.main-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: all 0.3s;
}

/* Homepage Styles */
.homepage-main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color), #6b4ba8);
    color: white;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.topic-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(75, 49, 144, 0.2);
    border-color: var(--primary-color);
}

a.topic-card {
    text-decoration: none;
    color: inherit;
}

a.topic-card:visited {
    color: inherit;
}

.topic-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.html-icon {
    background-color: #e34c26;
}

.css-icon {
    background-color: #264de4;
}

.js-icon {
    background-color: #f7df1e;
    color: #000;
}

.wp-icon {
    background-color: #21759b;
    color: white;
}

.topic-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    text-decoration: none;
}

.topic-card h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.topic-card p {
    margin-bottom: 1.5rem;
    color: #666;
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #000;
}

.btn-primary:hover {
    background-color: #e6a820;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(253, 187, 48, 0.3);
}

/* Features Section */
.features {
    margin-top: 4rem;
}

.features h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: 8px;
}

.feature-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Footer */
.main-footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Code Blocks */
code {
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    border: 1px solid var(--code-border);
}

pre {
    background-color: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--primary-color);
        display: none;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }

    .main-nav li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-nav a {
        display: block;
        padding: 1rem;
    }

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

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

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

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero h2 {
        font-size: 2rem;
    }

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

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

