/* Academic Theme CSS Variables */
:root {
    --primary-color: #212529;
    --primary-hover: #2c3136;
    --secondary-color: #ffcd38;
    --secondary-hover: #ffc107;
    --bg-color: #f8f9fa;
    --light-gray: #e9ecef;
    --border-color: #dee2e6;
    --text-color: #333;
    --text-muted: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --font-heading: 'Georgia', serif;
    --font-body: 'Open Sans', 'Segoe UI', Arial, sans-serif;
}

/* Base Styles */
body {
    background-color: var(--bg-color);
    font-family: var(--font-body);
    color: var(--text-color);
    transition: var(--transition);
    line-height: 1.6;
}

/* Header Styles - Academic Theme */
.app-header {
    background-color: var(--primary-color);
    color: white;
    padding: 30px 0;
    border-bottom: 5px solid var(--secondary-color);
    margin-bottom: 30px;
}

.app-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.app-title i {
    font-size: 2.2rem;
    margin-right: 15px;
    color: var(--secondary-color);
}

.app-title h1 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.app-subtitle {
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.9;
    font-style: italic;
    font-family: var(--font-heading);
}

/* Navigation & Tabs - Academic Style */
.nav-pills .nav-link {
    border-radius: 0;
    border-bottom: 2px solid transparent;
    margin: 0 8px;
    color: var(--primary-color);
    padding: 8px 15px;
    transition: var(--transition);
    font-weight: 600;
}

.nav-pills .nav-link.active {
    background-color: transparent;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
}

.nav-pills .nav-link:hover:not(.active) {
    background-color: transparent;
    border-bottom: 2px solid var(--light-gray);
}

/* Mode Selector - Academic Style */
.mode-selector {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--secondary-color);
}

.mode-selector label, 
.range-selector label {
    font-weight: 700;
    margin-right: 15px;
    margin-bottom: 0;
    min-width: 80px;
    font-family: var(--font-heading);
    color: var(--primary-color);
}

/* Range Slider - Academic Style */
.range-selector {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--secondary-color);
}

.range-container {
    flex-grow: 1;
    padding: 15px 0 25px;
    position: relative;
}

.range-slider {
    width: 100%;
    height: 4px;
    background-color: var(--light-gray);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 2px;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--secondary-color);
    height: 18px;
    width: 18px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.range-slider::-moz-range-thumb {
    background: var(--secondary-color);
    height: 18px;
    width: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.slider-value {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    position: absolute;
    transform: translateX(-50%);
    transition: left 0.2s;
    top: -5px;
}

.slider-value::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

/* Text Area Cards - Academic Style */
.text-area-card {
    background-color: white;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.text-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--light-gray);
}

.text-area-title {
    font-weight: 600;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.text-area-actions {
    display: flex;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-area-container {
    flex-grow: 1;
    min-height: 300px;
    position: relative;
}

/* Text Input - Academic Style */
.text-input {
    width: 100%;
    height: 100%;
    padding: 15px 20px;
    border: none;
    resize: none;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
}

.text-input:focus {
    outline: none;
}

.text-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-style: italic;
}

/* Alert Container */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    width: 350px;
}

.custom-alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    box-shadow: var(--box-shadow);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.custom-alert.show {
    opacity: 1;
    transform: translateX(0);
}

.alert-icon {
    margin-right: 15px;
    font-size: 1.5rem;
}

.alert-content {
    flex-grow: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-family: var(--font-heading);
}

.alert-success {
    background-color: #d4edda;
    border-left: 5px solid var(--success-color);
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-left: 5px solid var(--danger-color);
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-left: 5px solid var(--info-color);
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border-left: 5px solid var(--warning-color);
    color: #856404;
}

/* Language Dropdown - Academic Style */
.language-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    border-radius: 3px;
    padding: 8px 15px;
    background-color: white;
    border: 1px solid var(--border-color);
}

.language-dropdown .dropdown-toggle::after {
    margin-left: 10px;
}

.language-dropdown .dropdown-menu {
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    padding: 8px;
}

.language-dropdown .dropdown-item {
    padding: 8px 12px;
    border-radius: 3px;
    display: flex;
    align-items: center;
}

.language-dropdown .dropdown-item:hover {
    background-color: var(--light-gray);
}

.language-dropdown .dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

.language-flag {
    width: 20px;
    margin-right: 8px;
}

/* Theme toggle - Academic Style */
.theme-toggle .btn {
    border-radius: 3px;
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid var(--border-color);
}

.theme-toggle .btn i {
    margin-right: 5px;
}

/* Character count - Academic Style */
.character-count {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: right;
    padding: 8px 15px;
    border-top: 1px solid var(--border-color);
    background-color: var(--light-gray);
    font-family: var(--font-body);
}

/* Tools Container - Academic Style */
.tools-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tool-btn {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 3px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    flex-grow: 1;
    justify-content: center;
    font-weight: 600;
}

.tool-btn:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: var(--light-gray);
}

.tool-btn i {
    margin-right: 8px;
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Paraphrase Button - Academic Style */
.btn-paraphrase {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 3px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    font-family: var(--font-heading);
}

.btn-paraphrase:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.btn-paraphrase:active {
    transform: translateY(0);
}

.btn-paraphrase i {
    margin-right: 8px;
}

/* Reset button - Academic Style */
.btn-outline-secondary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 3px;
    font-weight: 600;
    font-family: var(--font-heading);
}

.btn-outline-secondary:hover {
    color: white;
    background-color: var(--primary-color);
}

/* Dark Mode Styles - Academic Theme */
body.dark-mode {
    --bg-color: #121212;
    --light-gray: #2a2a2a;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #444;
}

body.dark-mode .text-area-card,
body.dark-mode .mode-selector,
body.dark-mode .range-selector,
body.dark-mode .tool-btn {
    background-color: #1e1e1e;
    border-color: #444;
}

body.dark-mode .text-area-header,
body.dark-mode .character-count {
    background-color: #2a2a2a;
}

body.dark-mode .text-input {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

body.dark-mode .text-input::placeholder {
    color: #777;
}

body.dark-mode .nav-pills .nav-link:not(.active) {
    color: #e0e0e0;
}

body.dark-mode .theme-toggle .btn {
    color: #e0e0e0;
    background-color: #2a2a2a;
    border-color: #555;
}

body.dark-mode .theme-toggle .btn i {
    color: var(--secondary-color);
}

/* Fix for dark theme dropdown */
body.dark-mode .dropdown-menu {
    background-color: #1e1e1e;
    border-color: #444;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover:not(.active) {
    background-color: #2a2a2a;
}

body.dark-mode .dropdown-divider {
    border-color: #444;
}

body.dark-mode .language-dropdown .dropdown-toggle {
    background-color: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

/* Footer - Academic Style */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--primary-color);
    color: white;
}

.footer p {
    margin-bottom: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .text-area-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .text-area-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
    }
    
    .tool-btn {
        flex-basis: calc(50% - 5px);
    }
    
    .mode-selector, .range-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mode-selector label, .range-selector label {
        margin-bottom: 10px;
    }
    
    .mode-pills {
        margin-left: 0 !important;
    }
    
    .range-container {
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .app-title h1 {
        font-size: 1.8rem;
    }
    
    .btn-paraphrase, #resetBtn {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 10px;
    }
}