/* UTF2TTF - Malayalam Unicode to ASCII Converter Styles */

:root {
    --accent-blue: #007AFF;
    --accent-blue-hover: #0056b3;
    --accent-green: #34C759;
    --accent-red: #FF3B30;
    --accent-orange: #FF9500;
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    --bg-elevated: #3A3A3C;
    --text-primary: #FFFFFF;
    --text-secondary: #EBEBF5;
    --text-tertiary: #8E8E93;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --transition-fast: 150ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-medium: 250ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animation */
.bg-gradient-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 122, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(88, 86, 214, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.8) 0%, var(--bg-primary) 100%);
    animation: gradientShift 15s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% { background-position: 0% 0%, 100% 100%, 50% 50%; }
    100% { background-position: 100% 100%, 0% 0%, 50% 50%; }
}

/* Glass Card */
.glass-card {
    background: rgba(28, 28, 30, 0.75);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Header */
.app-header {
    padding-top: 3rem;
    padding-bottom: 2rem;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-subtitle {
    color: var(--text-tertiary);
    font-size: 1.125rem;
    margin-top: 0.5rem;
}

/* Textarea */
.textarea-container {
    position: relative;
    height: 100%;
}

.textarea-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.textarea-label-icon {
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0.8;
}

.converter-textarea {
    width: 100%;
    min-height: 280px;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.converter-textarea::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}

.converter-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
}

.output-textarea {
    background: rgba(0, 0, 0, 0.3);
    cursor: default;
}

.char-count {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: rgba(0, 0, 0, 0.5);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    pointer-events: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn:active {
    transform: scale(0.97);
}

.btn-icon {
    width: 1.125rem;
    height: 1.125rem;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-ghost {
    background: transparent;
    color: var(--accent-blue);
}

.btn-ghost:hover {
    background: rgba(0, 122, 255, 0.1);
}

.btn-success-flash {
    animation: successFlash 0.3s ease;
}

@keyframes successFlash {
    0%, 100% { background: var(--accent-blue); }
    50% { background: var(--accent-green); }
}

.btn-clear-flash {
    animation: clearFlash 0.3s ease;
}

@keyframes clearFlash {
    0%, 100% { background: var(--bg-elevated); }
    50% { background: rgba(255, 59, 48, 0.3); }
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* Converting Indicator */
.converting-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--accent-blue);
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--transition-fast);
}

.converting-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.converting-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(0, 122, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 8px 32px var(--shadow-color);
    opacity: 0;
    transition: all var(--transition-medium);
    z-index: 1000;
}

.toast-notification.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: bold;
}

.toast-success .toast-icon {
    background: rgba(52, 199, 89, 0.2);
    color: var(--accent-green);
}

.toast-error .toast-icon {
    background: rgba(255, 59, 48, 0.2);
    color: var(--accent-red);
}

.toast-info .toast-icon {
    background: rgba(0, 122, 255, 0.2);
    color: var(--accent-blue);
}

.toast-message {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* API Info Section */
.api-info {
    margin-top: 3rem;
    padding: 1.5rem;
    background: rgba(0, 122, 255, 0.05);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 16px;
}

.api-info-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.api-endpoint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    font-family: 'SF Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
    overflow-x: auto;
}

.api-method {
    padding: 0.25rem 0.5rem;
    background: var(--accent-green);
    color: black;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
}

/* Footer */
.app-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

.app-footer a {
    transition: color var(--transition-fast);
}

.app-footer a:hover {
    color: #3395ff;
}

/* Responsive */
@media (max-width: 640px) {
    .app-title {
        font-size: 1.75rem;
    }

    .glass-card {
        border-radius: 16px;
        padding: 1.25rem;
    }

    .converter-textarea {
        min-height: 200px;
        font-size: 0.9375rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}

/* Selection */
::selection {
    background: rgba(0, 122, 255, 0.3);
    color: white;
}
