/* CSS Variables for Modern Design */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --bg-primary: #f7fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Pattern */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

/* Main Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
}

/* Header Section */
.header {
    text-align: center;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo svg {
    color: #667eea;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.logo span {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Main Card */
.main-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

.main-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Input Section */
.input-section {
    margin-bottom: 1.5rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.input-label svg {
    color: #667eea;
}

.textarea-wrapper {
    position: relative;
}

#textArea {
    width: 100%;
    min-height: 200px;
    padding: 1.25rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-family: inherit;
    resize: both;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    line-height: 1.6;
    max-width: 100%;
    min-width: 100%;
}

#textArea:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

#textArea::placeholder {
    color: var(--text-light);
    font-style: italic;
}

.char-counter {
    position: absolute;
    bottom: 0.75rem;
    right: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

/* Action Section */
.action-section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    flex-wrap: wrap;
}

.copy-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 56px;
    position: relative;
    overflow: hidden;
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.copy-btn:hover::before {
    left: 100%;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

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

.copy-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.translate-btn {
    background: var(--secondary-gradient);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 56px;
    position: relative;
    overflow: hidden;
}

.translate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.translate-btn:hover::before {
    left: 100%;
}

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

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

.translate-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clear-btn {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-secondary);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    min-height: 56px;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--border-radius-sm);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.feature-item svg {
    color: #667eea;
    flex-shrink: 0;
}

/* Notification */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--success-gradient);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    transition: var(--transition);
    z-index: 1000;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification.show {
    transform: translateX(0);
    animation: slideInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification.hidden {
    display: none;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-icon {
    flex-shrink: 0;
}

@keyframes slideInBounce {
    0% {
        transform: translateX(120%);
    }
    70% {
        transform: translateX(-10%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Loading Animation for Copy Button */
.copy-btn.loading .btn-text {
    opacity: 0;
}

.copy-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .main-card {
        padding: 1.5rem;
    }
    
    .logo span {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    #textArea {
        min-height: 150px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .action-section {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .copy-btn, .translate-btn, .clear-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        transform: translateY(-120%);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    
    .main-card {
        padding: 1rem;
    }
    
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo span {
        font-size: 1.5rem;
    }
    
    #textArea {
        min-height: 120px;
        padding: 1rem;
    }
    
    .copy-btn, .clear-btn {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f7fafc;
        --text-secondary: #cbd5e0;
        --text-light: #718096;
        --bg-primary: #1a202c;
        --bg-card: rgba(45, 55, 72, 0.8);
        --glass-bg: rgba(0, 0, 0, 0.1);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
    
    #textArea {
        background: rgba(45, 55, 72, 0.7);
        color: var(--text-primary);
    }
    
    #textArea:focus {
        background: rgba(45, 55, 72, 0.9);
    }
    
    .clear-btn {
        background: rgba(45, 55, 72, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .clear-btn:hover {
        background: rgba(45, 55, 72, 1);
    }
    
    .feature-item {
        background: rgba(45, 55, 72, 0.6);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .feature-item:hover {
        background: rgba(45, 55, 72, 0.8);
    }
}

