/* Base Styles */
html {
    min-height: 100%;
    background-image: url("../images/notebook-background.svg");
    background-repeat: no-repeat;
    background-attachment: scroll;
    background-size: 100% auto;
    background-position: center top;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto Slab', Georgia, serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: transparent;
    position: relative;
    font-size: 16px;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url("../images/notebook-background.svg");
    background-repeat: repeat-y;
    background-size: 100% auto;
    background-position: center top;
}

/* Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Logo Styles */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 20px 0;
}

.logo {
    max-width: 50%;
    height: auto;
}

/* Content Sections */
.content-section {
    margin-bottom: 40px;
    width: 100%;
}

.content-inner {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
    text-align: center;
    box-sizing: border-box;
}

/* Typography */
.content-inner h1,
.content-inner h2,
.content-inner h3,
.content-inner h4,
.content-inner h5,
.content-inner h6 {
    text-align: center;
    font-family: 'Roboto Slab', Georgia, serif;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 20px;
    padding-bottom: 10px;
    display: inline-block;
}

.content-inner p {
    text-align: left;
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.5;
}

/* Typewriter Text Styles */
.typewriter-text {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1.1rem;
    line-height: 1.5;
}

.typewriter-bold {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1.5;
}

.typewriter-extra-bold {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

/* Image Alignment */
.img-align-right {
    float: right;
    margin: 0 0 15px 20px;
    max-width: 40%;
    height: auto;
    border-radius: 4px;
}

.img-align-left {
    float: left;
    margin: 0 20px 15px 0;
    max-width: 40%;
    height: auto;
    border-radius: 4px;
}

.img-align-center {
    display: block;
    margin: 20px auto;
    max-width: 70%;
    height: auto;
    border-radius: 4px;
    clear: both;
}

/* Image Styling */
.img-with-border {
    border: 1px solid #ddd;
    padding: 4px;
}

.img-with-shadow {
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Layout Utilities */
.clear-floats {
    clear: both;
    display: block;
    height: 0;
    overflow: hidden;
}

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

.flex-left, .flex-right {
    flex: 1;
    min-width: 250px;
}

/* Hero Section */
.hero-section-container {
    position: relative;
    margin: 40px auto;
    max-width: 1000px;
    padding: 20px;
    box-sizing: border-box;
}

.hero-section {
    padding: 40px 20px;
    text-align: center;
    background-color: transparent;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

.pencil-circle-container {
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    z-index: 2;
    pointer-events: none;
}

.pencil-circle {
    overflow: visible;
}

.pencil-stroke {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: pencilShake 10s infinite ease-in-out;
}

.pencil-stroke:nth-child(odd) {
    animation-delay: -2s;
}

.pencil-stroke:nth-child(3n) {
    animation-delay: -5s;
}

@keyframes pencilShake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    25% { transform: translate(1px, 0.5px) rotate(0.1deg); }
    50% { transform: translate(-0.5px, -1px) rotate(-0.05deg); }
    75% { transform: translate(-1px, 0) rotate(0.15deg); }
}

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    line-height: 1.1;
    letter-spacing: 0.02em;
    margin-bottom: 20px;
    color: #222;
    position: relative;
    z-index: 3;
}

.hero-subtitle {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 300;
    font-size: 2.5rem;
    line-height: 1.3;
    max-width: 800px;
    margin: 0 auto 30px;
    color: #444;
    position: relative;
    z-index: 3;
}

/* Form Styles */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.submit-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.submit-btn:hover {
    background-color: #0069d9;
}

#form-message {
    margin-top: 10px;
    color: #28a745;
}

/* Footer Styles */
.footer {
    background-color: #f8f9fa;
    padding: 20px 0;
    width: 100%;
    margin-top: auto;
    text-align: center;
}

.footer-info {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    width: 100%;
    display: block;
}

/* Grok Chat Styles */
.chat-section {
    margin: 40px auto;
    max-width: 800px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chat-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    background-color: #fff;
}

.chat-message {
    margin: 10px 0;
    padding: 12px;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.5;
}

.chat-message.user {
    background-color: #e0f7fa;
    margin-left: 20%;
    text-align: right;
}

.chat-message.grok {
    background-color: #f1f8e9;
    margin-right: 20%;
    text-align: left;
}

.chat-message.error {
    background-color: #f8d7da;
    color: #721c24;
    margin-right: 20%;
    text-align: left;
}

.chat-form {
    max-width: 600px;
    margin: 0 auto;
}

.chat-form .form-group label {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 5px;
    display: block;
    text-align: left;
}

.chat-form .form-group input[type="number"],
.chat-form .form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1rem;
    box-sizing: border-box;
}

.chat-form .submit-btn {
    width: 100%;
    padding: 12px;
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .content-inner p {
        font-size: 1rem;
    }

    .typewriter-text,
    .typewriter-bold {
        font-size: 1rem;
    }

    .typewriter-extra-bold {
        font-size: 1.2rem;
    }

    .img-align-right,
    .img-align-left {
        float: none;
        display: block;
        margin: 15px auto;
        max-width: 100%;
    }

    .img-align-center {
        max-width: 100%;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .hero-section {
        padding: 30px 15px;
    }

    .logo {
        max-width: 80%;
    }

    .chat-message.user,
    .chat-message.grok,
    .chat-message.error {
        margin-left: 10px;
        margin-right: 10px;
    }

    .chat-container {
        height: 300px;
    }
}

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

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

    .content-inner h1,
    .content-inner h2,
    .content-inner h3 {
        font-size: 1.5em;
    }

    .flex-container {
        flex-direction: column;
    }

    .content-inner p {
        font-size: 0.95rem;
    }

    .typewriter-text,
    .typewriter-bold {
        font-size: 0.95rem;
    }

    .typewriter-extra-bold {
        font-size: 1.1rem;
    }

    .chat-section {
        padding: 15px;
    }

    .chat-container {
        height: 250px;
    }

    .chat-form .form-group input[type="number"],
    .chat-form .form-group input[type="text"] {
        font-size: 0.95rem;
        padding: 8px;
    }

    .chat-form .submit-btn {
        font-size: 1rem;
        padding: 10px;
    }
}
