:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-hover: #1d4ed8;
    --primary-shadow: rgb(37 99 235 / 25%);
    
    /* Legacy Primary (for backward compatibility) */
    --primary-color: var(--primary);
    --primary-color-light: var(--primary-light);
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Legacy Semantic (for backward compatibility) */
    --success-color: var(--success);
    --danger-color: var(--danger);
    
    /* Surface Colors */
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --background: #f8fafc;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    /* Legacy Surface (for backward compatibility) */
    --surface-color: var(--surface);
    --light-bg: var(--background);
    
    /* Legacy Border (for backward compatibility) */
    --border-color: var(--border);
    
    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Legacy Text (for backward compatibility) */
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);
    
    /* Shadow System */
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
    --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
    --shadow-lg: 0 12px 24px rgb(15 23 42 / 0.12);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.5rem;
}

.generator-page {
    padding: 2rem 0;
}

.generator-intro {
    margin-bottom: 3rem;
}

.generator-title {
    font-size: clamp(2.25rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.generator-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    max-width: 860px;
}

.generator-meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
}

.meta-chip {
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.45rem 0.95rem;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.generator-main {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.generator-card {
    padding: 0rem 2rem;
    height: 100%;
}

.generator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-bar {
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.status-bar svg {
    flex-shrink: 0;
}

.status-info {
    background: var(--primary-color-light);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.table-controls-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface-color);
    color: var(--text-primary);
}

.control-btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.control-btn-primary:hover {
    transform: translateY(-1px);
}

.control-btn-danger {
    background: var(--danger-color);
    color: #ffffff;
    border-color: var(--danger-color);
}

.control-btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
}

.control-btn-secondary {
    background: var(--surface-color);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.control-btn-secondary:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.control-btn-info {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.control-btn-info:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.table-wrapper {
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--surface-color);
    box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.04);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-input {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.table-input td {
    border: 1px solid var(--border-color);
    padding: 0;
    position: relative;
    min-width: 120px;
}

.table-input input {
    width: 100%;
    border: none;
    outline: none;
    padding: 1rem 1.15rem;
    font-size: 1rem;
    background: transparent;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.table-input input:focus {
    background: var(--primary-color-light);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.table-input input:hover {
    background: var(--light-bg);
}

.table-input input::placeholder {
    color: var(--text-secondary);
}

.options-section,
.alignment-section {
    padding: 1.25rem;
    background: var(--light-bg);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.options-title,
.alignment-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.option-checkbox:hover {
    background: rgba(37, 99, 235, 0.05);
}

.option-checkbox input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.option-label {
    font-size: 0.9375rem;
    color: var(--text-primary);
    user-select: none;
}

.alignment-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alignment-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alignment-control label {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 600;
    min-width: 100px;
}

.alignment-control select {
    flex: 1;
    padding: 1rem 1.15rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    background: var(--surface-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.04);
}

.alignment-control select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.alignment-control select:hover {
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
    width: 100%;
}

.form-actions .generate-btn {
    flex: 1 1 auto;
    min-width: 140px;
}

.generate-btn {
    flex: 1 1 200px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px var(--primary-shadow);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn.loading,
.generate-btn:disabled {
    cursor: wait;
    opacity: 0.9;
}

.results-container {
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
    background: var(--light-bg);
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.output-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.output-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.output-actions .copy-button {
    flex: 1 1 auto;
    min-width: 140px;
}

.copy-button {
    background: #f1f5f9;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #405063 !important;
    border: 1px solid #dde3e7;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.copy-button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.copy-button.copied {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff !important;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.copy-buttons-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.copy-buttons-row .copy-button {
    flex: 1 1 auto;
    min-width: 140px;
}

.output-wrapper {
    margin-top: 0;
}

.output-textarea {
    width: 100%;
    min-height: 300px;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    
    background: var(--surface-color);
    color: var(--text-primary);
    resize: vertical;
    line-height: 1.6;
    box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.04);
    transition: all 0.2s ease;
}

.output-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.output-textarea:hover {
    border-color: var(--primary-color);
}

.preview-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.preview-wrapper {
    margin-top: 1rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background: var(--surface-color);
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.04);
}

.preview-placeholder {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    margin: 0;
}

.preview-wrapper table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.preview-wrapper table th,
.preview-wrapper table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.preview-wrapper table th {
    background: var(--primary-light);
    font-weight: 600;
    color: var(--primary-dark);
}

.preview-wrapper table td {
    background: var(--surface);
}

.preview-wrapper .text-center {
    text-align: center;
}

.preview-wrapper .text-right {
    text-align: right;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-trigger {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tooltip-trigger:hover {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

.tooltiptext {
    visibility: hidden;
    width: 200px;
    background: var(--text-main);
    color: var(--text-inverse);
    text-align: center;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
    line-height: 1.4;
    box-shadow: var(--shadow-lg);
}

.tooltip-trigger:hover + .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Share Container */
.share-container {
    margin-top: 0;
}

.share-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-btn i {
    font-size: 1.25rem;
}

.share-x {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.share-x:hover {
    background: #1a1a1a;
}

.share-facebook {
    background: #1877f2;
    color: #ffffff;
    border-color: #1877f2;
}

.share-facebook:hover {
    background: #166fe5;
}

.share-linkedin {
    background: #0077b5;
    color: #ffffff;
    border-color: #0077b5;
}

.share-linkedin:hover {
    background: #006399;
}

.share-reddit {
    background: #ff4500;
    color: #ffffff;
    border-color: #ff4500;
}

.share-reddit:hover {
    background: #e63e00;
}

.share-telegram {
    background: #0088cc;
    color: #ffffff;
    border-color: #0088cc;
}

.share-telegram:hover {
    background: #0077b3;
}

.share-whatsapp {
    background: #25d366;
    color: #ffffff;
    border-color: #25d366;
}

.share-whatsapp:hover {
    background: #20ba5a;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .generator-card {
        padding: 0rem 1rem;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .control-btn {
        width: 100%;
        justify-content: center;
    }
    
    .share-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .output-actions {
        flex-direction: column;
    }
    
    .output-actions .copy-button {
        width: 100%;
    }
    
    .results-container {
        padding: 1.5rem;
    }
}

/* Educational Content Styles */
.angle-seo-section {
    padding: 2rem 0;
}

.angle-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.angle-education-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.angle-education-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.angle-education-card p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.angle-education-card a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.angle-education-card a:hover {
    text-decoration: underline;
}

/* Infographic Styles */
.infographic-syntax,
.infographic-timeline {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--surface-muted);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.infographic-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 2rem;
}

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

.syntax-box {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.syntax-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.syntax-content {
    background: var(--text-main);
    color: #10b981;
    padding: 1rem;
    border-radius: var(--radius-sm);
    
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    overflow-x: auto;
}

.syntax-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.timeline-container {
    margin-top: 2rem;
}

.timeline-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.timeline-item {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    text-align: center;
}

.timeline-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: var(--primary);
}

.timeline-icon svg {
    width: 100%;
    height: 100%;
}

.timeline-era {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.timeline-years {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.timeline-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.infographic-conversion-formula {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.formula-box {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    text-align: center;
}

.formula-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.formula-content {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.formula-example {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .angle-card {
        padding: 2rem 1.5rem;
    }
    
    .syntax-examples,
    .timeline-items,
    .infographic-conversion-formula {
        grid-template-columns: 1fr;
    }
}

