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

body {
    font-family: 'Inter', 'Noto Sans Devanagari', sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-brand h2 {
    color: #4c51bf;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #4c51bf;
    color: white;
}

.btn-primary:hover {
    background: #434190;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-outline {
    background: transparent;
    color: #4c51bf;
    border: 2px solid #4c51bf;
}

.btn-outline:hover {
    background: #4c51bf;
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Authentication Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4c51bf;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
}

.auth-switch a {
    color: #4c51bf;
    text-decoration: none;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    padding: 3rem 0;
}

.welcome-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin: 2rem auto;
    max-width: 800px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.welcome-card h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Main App */
.main-app {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Translation Section */
.translation-section {
    margin-bottom: 2rem;
}

.language-selector {
    margin-bottom: 2rem;
}

.language-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.lang-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 200px;
    background: white;
}

.swap-btn {
    background: #4c51bf;
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swap-btn:hover {
    background: #434190;
    transform: rotate(180deg);
}

.translation-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.panel {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.panel-header {
    background: #f7fafc;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.panel-title {
    font-weight: 600;
    color: #2d3748;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

#source-text {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: none;
    font-family: 'Inter', 'Noto Sans Devanagari', sans-serif;
    font-size: 1rem;
    resize: vertical;
    outline: none;
}

.output-text {
    min-height: 200px;
    padding: 1rem;
    font-family: 'Inter', 'Noto Sans Devanagari', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #2d3748;
    background: #f7fafc;
}

/* Copy Protection */
.unselectable {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.unselectable::selection {
    background: transparent;
}

.unselectable::-moz-selection {
    background: transparent;
}

/* Disable right-click on protected content */
.output-text {
    pointer-events: none;
}

.panel-footer {
    padding: 1rem;
    background: #f7fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    font-size: 0.875rem;
    color: #718096;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-weight: 500;
    color: #718096;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #4c51bf;
    border-bottom-color: #4c51bf;
}

.tab-btn:hover {
    color: #4c51bf;
    background: rgba(76, 81, 191, 0.05);
}

/* Tab Content */
.tab-content {
    display: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #718096;
}

.history-text {
    margin-bottom: 0.5rem;
}

.source-text {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.translated-text {
    color: #4c51bf;
    font-family: 'Noto Sans Devanagari', sans-serif;
}

/* File Upload */
.upload-area {
    margin-bottom: 2rem;
}

.upload-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(247, 250, 252, 0.5);
}

.upload-zone:hover {
    border-color: #4c51bf;
    background: rgba(76, 81, 191, 0.05);
}

.upload-zone.dragover {
    border-color: #4c51bf;
    background: rgba(76, 81, 191, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-info {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.5rem;
}

/* Files List */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.file-meta {
    font-size: 0.875rem;
    color: #718096;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #718096;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    border-left: 4px solid #4c51bf;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: #48bb78;
}

.toast.error {
    border-left-color: #f56565;
}

.toast.warning {
    border-left-color: #ed8936;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .language-pair {
        flex-direction: column;
    }
    
    .lang-select {
        min-width: auto;
        width: 100%;
    }
    
    .translation-panels {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .welcome-card {
        padding: 2rem 1rem;
    }
    
    .welcome-card h1 {
        font-size: 1.875rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .tabs {
        overflow-x: auto;
    }
    
    .file-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar, .auth-overlay, .loading-overlay, .toast-container {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .main-app {
        background: white;
        box-shadow: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-outline {
        border-width: 3px;
    }
    
    .panel {
        border-width: 3px;
    }
    
    .upload-zone {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .swap-btn:hover {
        transform: none;
    }
    
    .btn-primary:hover {
        transform: none;
    }
} 