:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --input-bg: #1e293b;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.top-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

.btn-calendarena {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-calendarena:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    width: 40px;
    height: 40px;
}

.theme-toggle:hover {
    background-color: var(--border-color);
}

main {
    flex: 1;
}

.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-color);
    padding: 0.4rem;
    border-radius: 12px;
}

.mode-tab {
    flex: 1;
    padding: 0.8rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.mode-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1.1rem;
    transition: var(--transition);
    outline: none;
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

input[type="number"],
select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1.1rem;
    transition: var(--transition);
    outline: none;
}

input[type="number"]:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.result-area {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.copy-btn.copied {
    background-color: #22c55e;
    border-color: #22c55e;
    color: white;
}

.result-text {
    font-size: 1.4rem;
    font-weight: 700;
    word-break: break-word;
}

.adsense-container {
    margin: 1.5rem 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    overflow: hidden;
    min-height: 20px;
    /* Reduced to avoid large gaps when empty */
}

[data-theme="dark"] .adsense-container {
    background-color: rgba(255, 255, 255, 0.02);
}

/* SEO Content Styling */
.seo-content {
    margin-top: 3rem;
    padding: 3rem 2rem;
    text-align: left;
}

.seo-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.seo-content h3 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.seo-content p {
    margin-bottom: 1.2rem;
    color: var(--text-color);
    opacity: 0.9;
}

.seo-content ul,
.seo-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
}

.table-container {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: rgba(99, 102, 241, 0.05);
    font-weight: 700;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    border-left: 3px solid var(--primary-color);
}

[data-theme="dark"] .faq-item {
    background-color: rgba(255, 255, 255, 0.02);
}

.faq-item h4 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

@media (max-width: 640px) {
    .seo-content {
        padding: 2rem 1.2rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .result-text {
        font-size: 1.2rem;
    }
}