/* ========================================
   SIMASIASTUDIO - ANTHROPIC-INSPIRED DESIGN
   Warm Minimalism with Network Intelligence
   ======================================== */

:root {
    /* SimasiaAI Warm Palette */
    --primary: #3D8B87;
    /* Teal - main brand */
    --primary-dark: #2A6864;
    --primary-light: #5AA8A3;
    --accent-coral: #E87461;
    /* Coral accent */
    --accent-peach: #F4A89A;

    /* Warm Neutrals */
    --bg: #F5F3ED;
    /* Warm off-white */
    --bg-alt: #FFFFFF;
    /* Pure white */
    --bg-cream: #FAF8F3;
    --text: #1A1A1A;
    /* Almost black */
    --text-secondary: #4A4A4A;
    --text-muted: #8A8A8A;
    --border: #E5E3DA;

    /* Network Graphics */
    --node-teal: rgba(61, 139, 135, 0.6);
    --node-coral: rgba(232, 116, 97, 0.6);
    --node-light: rgba(61, 139, 135, 0.15);
    --connection: rgba(61, 139, 135, 0.2);

    /* Shadows - Subtle */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    /* Other */
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #1A1A1A;
    --bg-alt: #2A2A2A;
    --bg-cream: #252525;
    --text: #F5F3ED;
    --text-secondary: #C0C0C0;
    --text-muted: #8A8A8A;
    --border: #3A3A3A;
}

/* ========================================
   RESET & BASE
   ======================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    position: relative;
    overflow-x: hidden;
}

/* Network Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 15% 15%, var(--node-light) 0%, transparent 15%),
        radial-gradient(circle at 85% 20%, rgba(232, 116, 97, 0.1) 0%, transparent 15%),
        radial-gradient(circle at 25% 85%, var(--node-light) 0%, transparent 15%),
        radial-gradient(circle at 90% 75%, rgba(232, 116, 97, 0.08) 0%, transparent 15%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
}

h2 {
    font-size: 2.25rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.375rem;
}

/* ========================================
   NAVIGATION - CLEAN & MINIMAL
   ======================================== */

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .navbar {
    background: rgba(26, 26, 26, 0.95);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.nav-brand i {
    color: var(--primary);
    font-size: 1.5rem;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.language-switch {
    display: flex;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.lang-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.lang-btn:hover {
    color: var(--text);
}

.lang-btn.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.theme-toggle {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   HERO - ANTHROPIC STYLE
   ======================================== */

.hero {
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero h1 i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.company-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    margin-top: 1rem;
}

.company-badge i {
    color: var(--primary);
}

.company-badge strong {
    color: var(--text);
    font-weight: 600;
}

.company-badge a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.company-badge a:hover {
    color: var(--primary-dark);
}

/* ========================================
   EDITOR - CLEAN CARD DESIGN
   ======================================== */

.editor {
    background: var(--bg-alt);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.editor-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem 2.5rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

/* Mobile-first: Stack header buttons vertically by default */
.editor-header>div:last-child {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem;
    width: 100%;
}

.editor-header>div:last-child .btn {
    width: 100% !important;
    display: flex !important;
}

/* ========================================
   TOOLBAR - MINIMAL CONTROLS
   ======================================== */

.toolbar {
    background: var(--bg-cream);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.toolbar-section,
.toolbar-left {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: var(--bg-alt);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

select:hover {
    border-color: var(--primary-light);
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61, 139, 135, 0.1);
}

/* ========================================
   BUTTONS - ANTHROPIC STYLE
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(61, 139, 135, 0.25);
}

.btn-secondary {
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.btn-warning {
    background: var(--accent-coral);
    color: white;
}

.btn-warning:hover {
    background: #d66553;
    box-shadow: 0 4px 16px rgba(232, 116, 97, 0.25);
}

.btn-light {
    background: white;
    color: var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.95);
}

/* ========================================
   SPECIAL SECTIONS
   ======================================== */

.greek-checker-section,
.auto-correct-section,
.styleguide-section,
.translation-section {
    padding: 2rem 2.5rem !important;
    border-bottom: 1px solid var(--border);
    background: var(--bg-cream);
}

.section-content {
    display: flex !important;
    gap: 1.5rem !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

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

/* ========================================
   EDITOR LAYOUT - SPLIT VIEW
   ======================================== */

.editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
}

.input-section {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-right: 1px solid var(--border);
    background: var(--bg-alt);
}

.text-input {
    width: 100%;
    min-height: 400px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-size: 0.9375rem;
    line-height: 1.7;
    background: var(--bg-alt);
    color: var(--text);
    resize: vertical;
    transition: var(--transition);
}

.text-input:hover {
    border-color: var(--primary-light);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61, 139, 135, 0.1);
}

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

/* ========================================
   STATS - CLEAN METRICS
   ======================================== */

.stats {
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ========================================
   RESULTS SECTION
   ======================================== */

.results-section {
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.tabs {
    display: flex;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    gap: 0;
    padding: 0 1rem;
    flex-wrap: nowrap;
    /* Keep tabs in one row but scrollable */
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.tabs::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    padding: 2.5rem;
    background: var(--bg-alt);
    min-height: 500px;
    animation: fadeIn 0.3s ease;
    scroll-margin-top: 100px;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   EMPTY STATE & LOADING
   ======================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    color: var(--primary);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--primary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   RESULTS CONTENT - CLEAN CARDS
   ======================================== */

.result {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.result:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.result-header i {
    font-size: 1.25rem;
    color: var(--primary);
}

.result-title {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text);
}

.result-content {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* ========================================
   ISSUES & ALERTS
   ======================================== */

.issue {
    background: var(--bg-cream);
    border-left: 3px solid;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.9375rem;
}

.issue.high {
    border-left-color: #EF4444;
    background: rgba(239, 68, 68, 0.05);
}

.issue.medium {
    border-left-color: #F59E0B;
    background: rgba(245, 158, 11, 0.05);
}

.issue.low {
    border-left-color: var(--primary);
    background: rgba(61, 139, 135, 0.05);
}

.alternative {
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1rem 0;
}

.alternative-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.alternative-title {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

.alternative-text {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 0.9375rem;
    line-height: 1.7;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin: 1rem 0;
    font-size: 0.9375rem;
    border: 1px solid;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #FCA5A5;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border-color: #BBF7D0;
}

.alert-info {
    background: #EFF6FF;
    color: #1E40AF;
    border-color: #93C5FD;
}

/* ========================================
   MODALS
   ======================================== */

.login-overlay,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    animation: fadeIn 0.2s ease;
}

.login-modal,
.modal {
    background: var(--bg-alt);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   FOOTER - MINIMAL
   ======================================== */

.footer {
    background: var(--text);
    color: var(--bg);
    padding: 3rem 2rem;
    margin-top: 4rem;
    position: relative;
    z-index: 1;
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .input-section {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Desktop: Switch header buttons to horizontal */
    .editor-header>div:last-child {
        flex-direction: row !important;
        gap: 0.75rem;
    }

    .editor-header>div:last-child .btn {
        width: auto !important;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .container {
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    .nav-container {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        max-width: 100%;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .editor-header {
        padding: 1rem !important;
        flex-direction: column;
        gap: 1rem;
    }

    .toolbar {
        padding: 1rem !important;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-controls {
        flex-wrap: wrap !important;
        justify-content: center;
        gap: 0.5rem;
    }

    .styleguide-section,
    .translation-section,
    .greek-checker-section,
    .auto-correct-section,
    .section-content {
        padding: 1rem !important;
    }

    .text-input {
        min-height: 300px;
    }

    .stats {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 1rem;
    }

    .form-group {
        min-width: 0 !important;
        width: 100% !important;
    }

    .hero p,
    .section-content,
    .editor-header,
    .toolbar,
    .nav-container,
    .container {
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-wrap: break-word !important;
    }

    img,
    video,
    iframe,
    canvas,
    svg {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Prevent text overflow */
    body,
    p,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    span,
    div {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .text-input {
        min-height: 300px;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Force buttons to wrap text on mobile */
    .btn,
    button,
    .nav-btn,
    .nav-controls a {
        white-space: normal !important;
        height: auto !important;
        max-width: 100% !important;
        overflow-wrap: break-word !important;
        margin-left: 2px !important;
        margin-right: 2px !important;
        margin-bottom: 5px !important;
    }

    .nav-controls {
        width: 100% !important;
        padding: 0 !important;
    }

    /* Mobile padding overrides to prevent layout overflow */
    .greek-checker-section,
    .auto-correct-section,
    .styleguide-section,
    .translation-section,
    .input-section,
    .tab-content,
    .hero {
        padding: 1rem 0.5rem !important;
    }

    /* Force editor to stack vertically */
    .editor-layout {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .input-section {
        border-right: none !important;
        width: 100% !important;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

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

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

.font-bold {
    font-weight: 700;
}

.text-primary {
    color: var(--primary);
}