/**
 * Kannada Converter Styles
 * Modern Elegant Design with Warm Neutral Palette
 */

:root {
    /* Warm Neutral Color Palette */
    --cream-bg: #F5F1E8;
    --cream-light: #FAF7F2;
    --cream-card: #FFFFFF;
    --beige-accent: #E8DCC8;
    --tan-gold: #C9A961;
    --gold-hover: #B89550;
    
    /* Dark Accents */
    --dark-primary: #1A1A1A;
    --dark-secondary: #2C2C2C;
    --dark-tertiary: #4A4A4A;
    --text-muted: #6B6B6B;
    
    /* Functional Colors */
    --success: #138808;
    --success-light: #E8F5E9;
    --error: #C33;
    --error-light: #FFEBEE;
    --info: #5B8DB8;
    --info-light: #E3F2FD;
    
    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.16);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Kannada', 'Helvetica Neue', Arial, sans-serif;
    background: var(--cream-bg);
    color: var(--dark-primary);
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    letter-spacing: 0.01em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header - Elegant Hero Section */
.header {
    background: var(--cream-light);
    color: var(--dark-primary);
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 50px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: var(--tan-gold);
    border-radius: 50%;
    opacity: 0.15;
    margin-top: -40px;
}

.header h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.8rem;
    margin-bottom: 16px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--dark-primary);
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.15rem;
    opacity: 0.85;
    position: relative;
    z-index: 1;
    font-weight: 400;
    color: var(--dark-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

.header-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: var(--tan-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
}

.header-subtitle {
    font-size: 1rem;
    opacity: 0.7;
    margin-top: 8px;
    font-style: italic;
}

.flag-accent {
    height: 3px;
    background: var(--tan-gold);
    margin-top: 24px;
    border-radius: 2px;
    width: 80px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.6;
}

/* Tabs - Elegant Navigation */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-button {
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    padding: 18px 28px;
    background: var(--cream-card);
    border: 1px solid var(--beige-accent);
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--dark-secondary);
    letter-spacing: 0.02em;
}

.tab-button:hover {
    background: var(--cream-light);
    color: var(--dark-primary);
    border-color: var(--tan-gold);
    box-shadow: var(--shadow-sm);
}

.tab-button.active {
    background: var(--dark-primary);
    color: var(--cream-light);
    border-color: var(--dark-primary);
    font-weight: 600;
}

/* Tab Content - Elegant Cards */
.tab-content {
    display: none;
    background: var(--cream-card);
    padding: 48px;
    border-radius: 0;
    box-shadow: var(--shadow-md);
    margin-top: -1px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Elements - Clean & Professional */
.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--dark-primary);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--beige-accent);
    border-radius: 2px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--cream-card);
    color: var(--dark-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--tan-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.1);
    background: #FFFFFF;
}

textarea.form-control {
    min-height: 160px;
    resize: vertical;
    line-height: 1.6;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A4A4A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

/* File Input - Elegant Drop Zone */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-input-label {
    display: block;
    padding: 60px 40px;
    background: var(--cream-light);
    border: 2px dashed var(--beige-accent);
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.file-input-label:hover {
    border-color: var(--tan-gold);
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.file-input-label.dragging {
    border-color: var(--tan-gold);
    background: #FFFFFF;
    box-shadow: var(--shadow-md);
    border-style: solid;
}

.file-input-label i {
    font-size: 3rem;
    color: var(--tan-gold);
    margin-bottom: 10px;
    transition: transform 0.3s;
}

.file-input-label:hover i {
    transform: scale(1.1);
}

/* Buttons - Elegant & Professional */
.btn {
    display: inline-block;
    padding: 15px 36px;
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--dark-primary);
    color: var(--cream-light);
    border-color: var(--dark-primary);
}

.btn-primary:hover {
    background: var(--dark-secondary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--tan-gold);
    color: var(--cream-card);
    border-color: var(--tan-gold);
}

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

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover {
    background: #0F6E06;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

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

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Info Cards - Elegant Information Display */
.info-card {
    background: var(--cream-light);
    border-left: 3px solid var(--tan-gold);
    padding: 28px 32px;
    margin: 24px 0;
    border-radius: 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-card:hover {
    box-shadow: var(--shadow-md);
}

.info-card h3 {
    color: var(--dark-primary);
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 500;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: -0.01em;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--beige-accent);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.info-value {
    color: var(--dark-primary);
    font-weight: 500;
}

/* Preview Area - Clean Display */
.preview-area {
    margin: 24px 0;
}

.preview-area label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--dark-primary);
    font-size: 0.95rem;
}

.preview-area textarea {
    width: 100%;
    min-height: 140px;
    padding: 16px;
    border: 1px solid var(--beige-accent);
    border-radius: 2px;
    font-family: 'Courier New', 'Noto Sans Kannada', monospace;
    font-size: 0.95rem;
    background: var(--cream-light);
    resize: vertical;
    color: var(--dark-primary);
    line-height: 1.6;
}

/* Messages - Professional Notifications */
.message {
    padding: 16px 24px;
    border-radius: 2px;
    margin: 20px 0;
    display: none;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    border-left: 3px solid;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    background: var(--error-light);
    border-left-color: var(--error);
    color: var(--error);
}

.error-message::before {
    content: '⚠️ ';
    margin-right: 8px;
}

.success-message {
    background: var(--success-light);
    border-left-color: var(--success);
    color: var(--success);
}

.success-message::before {
    content: '✓ ';
    margin-right: 8px;
    font-weight: bold;
}

.progress-indicator {
    background: var(--info-light);
    border-left-color: var(--info);
    color: var(--info);
}

.progress-indicator::before {
    content: '⏳ ';
    margin-right: 8px;
}

/* Help Section - Clean Documentation */
.help-section {
    margin: 32px 0;
}

.help-section h3 {
    color: var(--dark-primary);
    margin-bottom: 18px;
    font-size: 1.35rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.help-section h4 {
    color: var(--dark-secondary);
    margin: 20px 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.help-section p {
    margin-bottom: 12px;
    line-height: 1.8;
    color: var(--dark-secondary);
}

.help-section ul,
.help-section ol {
    margin-left: 28px;
    margin-bottom: 18px;
}

.help-section li {
    margin-bottom: 10px;
    line-height: 1.7;
    color: var(--dark-secondary);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 28px 0;
}

.feature-card {
    background: var(--cream-card);
    padding: 28px 24px;
    border-radius: 0;
    border-top: 2px solid var(--tan-gold);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.feature-card h4 {
    color: var(--dark-primary);
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Footer - Elegant Closing */
.footer {
    background: var(--cream-light);
    padding: 32px;
    text-align: center;
    margin-top: 60px;
    border-radius: 0;
    box-shadow: var(--shadow-sm);
}

.footer p {
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.footer a {
    color: var(--dark-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--tan-gold);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .header {
        padding: 40px 24px;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
        max-width: 100%;
    }
    
    .tab-content {
        padding: 32px 24px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .info-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px 10px;
    }
    
    .header {
        padding: 32px 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .tab-content {
        padding: 24px 16px;
    }
    
    .file-input-label {
        padding: 40px 24px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .header, .tabs, .btn-group, .footer {
        display: none;
    }
    
    .tab-content {
        display: block !important;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* Character Count Badge */
.char-count {
    display: inline-block;
    padding: 6px 14px;
    background: var(--beige-accent);
    color: var(--dark-secondary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.char-count:hover {
    background: var(--tan-gold);
    color: var(--cream-card);
}

/* Format Badge */
.format-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.format-badge.unicode {
    background: var(--success-light);
    color: var(--success);
}

.format-badge.ascii {
    background: var(--beige-accent);
    color: var(--dark-secondary);
}

/* Stray Character Detection Styles */
.stray-chars-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--beige-accent);
    border-radius: 4px;
    background: var(--cream-light);
}

.stray-char-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--beige-accent);
    transition: background 0.2s ease;
}

.stray-char-item:last-child {
    border-bottom: none;
}

.stray-char-item:hover {
    background: #FFFFFF;
}

.stray-char-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stray-char-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.stray-char-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--error-light);
    color: var(--error);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.stray-location {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stray-type {
    font-size: 0.85rem;
    color: var(--info);
    font-style: italic;
}

.stray-context {
    background: #FFFFFF;
    padding: 10px 14px;
    border-left: 3px solid var(--error);
    border-radius: 2px;
    font-family: 'Courier New', 'Noto Sans Kannada', monospace;
    font-size: 0.9rem;
    color: var(--dark-primary);
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.stray-context-highlight {
    background: rgba(204, 51, 51, 0.15);
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 700;
    color: var(--error);
}

.no-stray-message {
    padding: 30px;
    text-align: center;
    color: var(--success);
    font-size: 1.1rem;
    background: var(--success-light);
    border-radius: 4px;
    border: 2px solid var(--success);
}

.no-stray-message::before {
    content: '✓ ';
    font-size: 1.5rem;
    margin-right: 8px;
}

/* Responsive adjustments for stray detection */
@media (max-width: 768px) {
    .stray-char-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .stray-char-info {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .stray-chars-container {
        max-height: 400px;
    }
}
