/* Main Styles */
/* Base responsive setup */
html {
    box-sizing: border-box;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

*, *:before, *:after {
    box-sizing: inherit;
}

/* Custom properties */
:root {
    --primary-color: #2196f3;
    --secondary-color: #ff4081;
    --accent-color: #7c4dff;
    --success-color: #00c853;
    --background-color: #e3f2fd;
    --text-color: #2c3e50;
    --header-height: 70px;
    --footer-height: 300px;
    --gradient-primary: linear-gradient(135deg, #2196f3, #1976d2);
    --gradient-secondary: linear-gradient(135deg, #ff4081, #c51162);
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --container-padding: clamp(1rem, 5vw, 2rem);
    --content-width: min(1200px, 100% - 2rem);
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive container */
.container {
    width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Responsive typography */
h1 {
    font-family: 'Merriweather', serif;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.15;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    line-height: 1.4;
}

p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.6;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* background-color: var(--background-color); */
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* background-image: url("../images/background2.jpg");   */
}

/* Header Styles */
.header {
    height: var(--header-height);
    /* background: var(--gradient-primary); */
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    color: white;
    background-color: #0d130f;
}

.logo-container {
    height: 50px;
}

.logo {
    height: 100%;
    width: auto;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin-left: 2rem;
}

.nav-link {
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main Content Styles */
.main-content {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    padding: 2rem;
}

.generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.diagram-form {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    border: 2px solid #e1f5fe;
    transition: transform 0.3s ease;
}

.diagram-form:hover {
    transform: translateY(-5px);
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Center action buttons in forms */
.form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
}

/* Ensure the generate button doesn't get too wide on large screens but stays centered */
.form-actions .magic-btn {
    max-width: 320px;
    width: 100%;
    background: linear-gradient(135deg, #007bff, #00d4ff);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

.magic-btn:hover {
  background: linear-gradient(135deg, #0062cc, #00b8d8);
  box-shadow: 0 6px 14px rgba(0, 123, 255, 0.3);
  transform: translateY(-2px);
}

.magic-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 8px rgba(0, 123, 255, 0.2);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.mui-select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e3f2fd;
    border-radius: 12px;
    font-size: 1rem;
    background-color: white;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* inline SVG arrow for consistent rendering across browsers */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20'><path fill='%232c3e50' d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
    cursor: pointer;
}

.mui-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
    outline: none;
}

.mui-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e3f2fd;
    border-radius: 12px;
    font-size: 1rem;
    background-color: white;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 150px;
    line-height: 1.6;
}

.mui-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
}

.diagram-output {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.diagram-box {
    width: 100%;
    min-height: 400px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    padding: 1rem;
    background-color: white;
    transition: all 0.3s ease;
}

.loading-text {
    color: var(--primary-color);
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid var(--background-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.placeholder-text {
    color: #999;
    text-align: center;
}

/* Footer Styles */
.footer {
    /* background: var(--gradient-primary); */
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
    background-color: #0d130f;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-section a:hover {
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Examples Page Styles */
.examples-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.diagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.diagram-example {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.diagram-example img {
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.diagram-example h3 {
    margin: 1rem 0;
}

/* Pricing Page Styles */
.pricing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.pricing-subtitle {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    opacity: 0.8;
}

.pricing-grid {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pricing-note {
    margin-top: 1rem;
    color: var(--accent-color);
    font-size: 0.9rem;
}

.pricing-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--box-shadow);
    position: relative;
    max-width: 400px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid var(--primary-color);
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 24px rgba(33, 150, 243, 0.2);
}

.pricing-card.featured {
    border: 2px solid var(--primary-color);
}

.featured-label {
    position: absolute;
    top: 20px;
    right: -35px;
    background: var(--gradient-secondary);
    color: white;
    padding: 0.5rem 4rem;
    transform: rotate(45deg);
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
}

.price span {
    font-size: 1rem;
    color: var(--secondary-color);
}

.features {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    text-align: left;
}

.features li {
    margin: 1rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.start-button {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    width: 100%;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* Contact Page Styles */
.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 3rem;
    margin-top: 2rem;
}

.contact-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mui-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 0.25rem;
}

.contact-info {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.info-item i {
    margin-right: 1rem;
    color: var(--primary-color);
}

.info-item h4 {
    margin: 0 0 0.5rem 0;
}

.info-item p {
    margin: 0;
    color: var(--secondary-color);
}

/* Responsive Design */
/* Tablet and smaller desktop screens */
@media (max-width: 1024px) {
    .generator-container {
        grid-template-columns: 1fr;
        max-width: 800px;
        margin: 0 auto;
    }

    .diagram-form,
    .diagram-output {
        margin: 1rem;
    }

    .pricing-card {
        max-width: 80%;
        margin: 0 auto;
    }
}

/* Hamburger Menu Styles */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    position: relative;
    z-index: 1000;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    position: relative;
    transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: white;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.menu-toggle.open .hamburger {
    background: transparent;
}

.menu-toggle.open .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle.open .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Mobile devices */
@media (max-width: 768px) {
    /* Header adjustments */
    .header {
        position: fixed;
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: var(--header-height);
    }

    .menu-toggle {
        display: block;
    }

    .logo-container {
        margin: 0;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--gradient-primary);
        padding: 1rem;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        opacity: 0;
        visibility: hidden;
    }

    .main-nav.nav-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        padding: 0;
        margin: 0;
    }

    .main-nav li {
        margin: 0.5rem 0;
        width: 100%;
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: 0.75rem;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        font-size: 1.1rem;
    }

    /* Main content adjustments */
    .main-content {
        margin-top: calc(var(--header-height) + 1rem);
        padding: 1rem;
    }

    .generator-container,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .diagram-form,
    .diagram-output,
    .contact-form,
    .contact-info {
        padding: 1.5rem;
    }

    .diagram-box {
        min-height: 300px;
    }

    /* Form elements */
    .form-group {
        margin-bottom: 1rem;
    }

    .mui-select,
    .mui-textarea {
        font-size: 16px; /* Prevents zoom on mobile */
        padding: 0.875rem;
    }

    .mui-btn {
        width: 100%;
        margin-top: 1rem;
    }

    /* Pricing adjustments */
    .pricing-container {
        padding: 1rem;
    }

    .pricing-card {
        max-width: 100%;
        padding: 2rem 1.5rem;
    }

    .featured-label {
        font-size: 0.875rem;
        padding: 0.4rem 3rem;
    }

    .features li {
        font-size: 1rem;
        margin: 0.75rem 0;
    }

    /* Footer adjustments */
    .footer {
        padding: 2rem 1rem 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-section {
        margin-bottom: 1.5rem;
    }

    .footer-section:last-child {
        margin-bottom: 0;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .header {
        padding: 0.75rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .pricing-subtitle {
        font-size: 1rem;
    }

    .pricing-card {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    .featured-label {
        right: -40px;
        padding: 0.3rem 3rem;
        font-size: 0.75rem;
    }

    .price {
        font-size: 2rem;
    }

    .start-button {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .diagram-form,
    .diagram-output {
        padding: 1rem;
    }

    .contact-grid {
        gap: 1rem;
    }

    .info-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .info-item i {
        margin: 0 0 0.5rem 0;
    }

.magic-btn {
  background: linear-gradient(90deg, #4A00E0, #8E2DE2);
  color: #fff;
  border: none;
  padding: 14px 28px;
  font-size: 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  box-shadow: 0px 4px 12px rgba(78, 0, 224, 0.3);
}

.magic-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0px 6px 16px rgba(78, 0, 224, 0.5);
}
}