:root {
    --primary-color: #4a90e2;
    --secondary-color: #5cb85c;
    --accent-color: #f0ad4e;
    --dark-color: #333;
    --light-color: #f9f9f9;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --transition-speed: 0.3s;
}

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

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

/* Header and Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: color var(--transition-speed);
}

nav a:hover {
    color: var(--primary-color);
}

#menuToggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    display: flex;
    min-height: 80vh;
    padding: 3rem 5%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.hero-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    color: var(--dark-color);
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
}

.hero-animation {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cipher-animation {
    width: 100%;
    height: 300px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color var(--transition-speed);
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn:hover {
    background-color: #357dc0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color var(--transition-speed);
    cursor: pointer;
    border: none;
    display: inline-block;
    text-align: center;
}

.btn-small:hover {
    background-color: #357dc0;
}

/* Sections */
section {
    padding: 4rem 5%;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    text-align: center;
}

.about p {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    text-align: center;
}

/* Lessons Grid */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.lesson-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform var(--transition-speed);
    position: relative;
    overflow: hidden;
}

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

.lesson-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary-color);
}

.card-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 70px;
    margin-bottom: 0.5rem;
}

.lesson-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.lesson-card p {
    color: #666;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Practice Section */
.practice-section {
    background-color: #f0f4f8;
}

.practice-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.practice-tool {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.practice-tool h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tool-interface {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.input-group label {
    font-weight: 500;
}

.input-group textarea,
.input-group input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-main);
    resize: vertical;
}

.input-group textarea {
    min-height: 100px;
}

.button-group {
    display: flex;
    gap: 1rem;
}

.result-display {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.result {
    margin-top: 0.5rem;
    word-break: break-all;
    font-family: monospace;
    white-space: pre-wrap;
}

/* Resources Section */
.resource-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.resource-group h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.resource-group ul {
    list-style: none;
}

.resource-group li {
    margin-bottom: 0.8rem;
}

.resource-group a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.resource-group a:hover {
    color: var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 5%;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: #ddd;
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-nav a:hover {
    color: white;
}

.footer-legal {
    width: 100%;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #444;
    font-size: 0.9rem;
    color: #aaa;
}

/* Responsive Design */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        gap: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .practice-tools {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #menuToggle {
        display: block;
    }
    
    nav ul {
        position: fixed;
        top: 70px;
        right: -100%;
        background-color: white;
        width: 250px;
        height: calc(100vh - 70px);
        flex-direction: column;
        gap: 0;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right var(--transition-speed);
        padding: 1rem 0;
    }
    
    nav ul.active {
        right: 0;
    }
    
    nav ul li {
        width: 100%;
    }
    
    nav ul li a {
        display: block;
        padding: 1rem 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-nav ul {
        flex-direction: column;
        gap: 0.8rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.lesson-card {
    animation: fadeIn 0.5s ease-out, slideUp 0.5s ease-out;
}

/* Caesar cipher animation for hero section */
@keyframes encryptText {
    0% { transform: translateY(0); opacity: 1; }
    20% { transform: translateY(-20px); opacity: 0; }
    40% { transform: translateY(20px); opacity: 0; }
    60% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}

.animated-text {
    display: inline-block;
    animation: encryptText 4s infinite;
}

