/* ============================================
   TranslateStack 
   Clean, Minimalist, Professional
   ============================================ */

/* ===== CSS Variables - DeepL Style ===== */
:root {
    --primary-color: #0d7eff;
    --primary-hover: #0a6ae6;
    --primary-light: #e6f2ff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-lighter: #f5f5f5;
    --border-color: #e0e0e0;
    --border-light: #e8e8e8;
    --success-color: #00c853;
    --error-color: #d32f2f;
    --warning-color: #ff9800;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: 200ms ease;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== Header ===== */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-square {
    width: 50px;
    height: 50px;
    background: #1b5e20;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.02em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color var(--transition);
    position: relative;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* Page Header Section */
.page-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.page-header .tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 400;
}

/* Main heading styles (for content) */
h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 400;
}

/* ===== Main Content ===== */
main {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

/* ===== Instructions Section ===== */
.instructions {
    background: #fff9e6;
    padding: 1.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    border: 1px solid #ffe082;
}

.instructions h2 {
    color: #f57c00;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instructions ol {
    margin-left: 1.5rem;
    color: var(--text-primary);
}

.instructions li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.instructions li strong {
    color: #f57c00;
    font-weight: 600;
}

/* ===== Translation Section ===== */
.translation-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 968px) {
    .translation-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ===== Input Groups ===== */
.input-group {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition);
}

.input-group:hover {
    border-color: var(--primary-color);
}

.input-group h3 {
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Form Elements ===== */
label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--bg-white);
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all var(--transition);
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230d7eff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

select:hover {
    border-color: var(--primary-color);
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 126, 255, 0.1);
}

/* ===== Excel-like Wrapper ===== */
.excel-wrapper {
    position: relative;
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    overflow: hidden;
    transition: all var(--transition);
}

.excel-wrapper:hover {
    border-color: var(--primary-color);
}

.excel-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 126, 255, 0.1);
}

.row-numbers {
    width: 40px;
    min-width: 40px;
    background: #f5f5f5;
    border-right: 1px solid #e0e0e0;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
    font-size: 0.8rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #666;
    text-align: right;
    user-select: none;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.row-numbers > div {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 0.25rem;
    box-sizing: border-box;
    width: 100%;
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0;
    font-size: 0.9rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: vertical;
    line-height: 1.6;
    transition: all var(--transition);
    background: var(--bg-white);
    color: var(--text-primary);
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    background-image: none;
    position: relative;
}

textarea:focus {
    background-image: none;
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* ===== Output Area ===== */
.output-area {
    width: 100%;
    min-height: 300px;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0;
    font-size: 0.9rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: var(--bg-white);
    color: var(--text-primary);
    overflow-y: auto;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: all var(--transition);
    background-image: none;
    outline: none;
    position: relative;
}

.excel-wrapper:focus-within .output-area {
    background-image: none;
}

.output-placeholder {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.6;
}

/* ===== Buttons ===== */
.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

button {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    flex: 1;
    min-width: 200px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-lighter);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Stats ===== */
.stats {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== Alerts ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-top: 1.25rem;
    border-left: 3px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background: #ffebee;
    border-color: var(--error-color);
    color: var(--error-color);
}

.alert-success {
    background: #e8f5e9;
    border-color: var(--success-color);
    color: var(--success-color);
}

/* ===== Spinner ===== */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Pricing Section ===== */
.pricing-section {
    margin-top: 3rem;
    padding: 2.5rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-light);
}

.pricing-section h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pricing-section > p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.pricing-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    text-align: left;
}

.pricing-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.pricing-card.featured {
    border: 2px solid var(--primary-color);
    background: var(--primary-light);
}

.plan-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.price {
    font-size: 2.25rem;
    font-weight: 600;
    margin: 1rem 0;
    color: var(--text-primary);
}

.pricing-card.featured .price {
    color: var(--primary-color);
}

.features-list {
    list-style: none;
    margin: 1.5rem 0;
}

.features-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.features-list li:before {
    content: "✓";
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pricing-card.featured .features-list li:before {
    color: var(--primary-color);
}

.pricing-card .btn-primary {
    width: 100%;
    margin-top: 1rem;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    color: var(--text-secondary);
}

footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition);
}

footer a:hover {
    text-decoration: underline;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header-nav {
        padding: 0.875rem 1.5rem;
    }

    .main-nav {
        gap: 1.5rem;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .page-header {
        padding: 2rem 1rem 1.5rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header .tagline {
        font-size: 1rem;
    }

    main {
        padding: 1.5rem;
    }

    .instructions {
        padding: 1.25rem;
    }

    .input-group {
        padding: 1.25rem;
    }

    .translation-section {
        gap: 1.25rem;
    }

    .pricing-section {
        padding: 1.5rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .header-nav {
        padding: 0.75rem 1rem;
    }

    .logo-square {
        width: 40px;
        height: 40px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .main-nav {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .page-header {
        padding: 1.5rem 1rem 1rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header .tagline {
        font-size: 0.9rem;
    }

    .instructions h2 {
        font-size: 1.1rem;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    header,
    main {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .button-group,
    .pricing-section,
    footer {
        display: none;
    }
}
