/**
 * Modern Text Case Converter Tool - Professional Styling
 * Following code-formatters standard with advanced text transformation features
 */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.hero-feature i {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main Content */
.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mode-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
}

.mode-tab.active {
    background: white;
    color: #495057;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mode-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.7);
    color: #495057;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Converter Section */
.converter-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.converter-section h3 {
    color: #495057;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.25rem;
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

.text-input-container {
    position: relative;
}

.text-input {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafafa;
    line-height: 1.6;
}

.text-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.text-input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.input-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fc;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #6c757d;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-value {
    font-weight: 600;
    color: #495057;
}

/* Options Section */
.options-section {
    background: #f8f9fc;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #e9ecef;
}

.options-section h4 {
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
    font-size: 1rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    cursor: pointer;
}

.option-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.option-item input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: #667eea;
}

.option-item label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    flex: 1;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

/* Conversion Results */
.conversion-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.conversion-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
    transition: all 0.3s ease;
}

.conversion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.conversion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.conversion-title {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conversion-copy-btn {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.conversion-copy-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.conversion-result {
    background: #f8f9fc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #495057;
    word-break: break-word;
    min-height: 3rem;
    display: flex;
    align-items: center;
}

.conversion-result.empty {
    color: #adb5bd;
    font-style: italic;
    justify-content: center;
}

/* Advanced Conversions */
.advanced-section {
    background: linear-gradient(135deg, #f8f9fc 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #dee2e6;
}

.advanced-section h3 {
    color: #495057;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.advanced-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f3f4;
}

.advanced-card h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Preset Templates */
.templates-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.template-card {
    background: linear-gradient(135deg, #f8f9fc 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.template-card h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-weight: 600;
}

.template-sample {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 1rem;
    color: #495057;
}

.template-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* History Section */
.history-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    flex: 1;
    min-width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #667eea;
    outline: none;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background-color: #f8f9fa;
}

.history-item:last-child {
    border-bottom: none;
}

.history-details {
    flex: 1;
    margin-right: 1rem;
}

.history-original {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-word;
}

.history-conversions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.history-conversion {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.history-timestamp {
    color: #adb5bd;
    font-size: 0.8rem;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.no-history {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.no-history i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: #495057;
    margin-bottom: 1rem;
    font-weight: 600;
}

.feature-card p {
    color: #6c757d;
    line-height: 1.6;
}

/* How to Use Section */
.how-to-use {
    background: linear-gradient(135deg, #f8f9fc 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 2rem;
    margin: 3rem 0;
}

.how-to-use h3 {
    color: #495057;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.steps-list {
    list-style: none;
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
}

.steps-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.step-number {
    background: #667eea;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.step-text {
    color: #495057;
    line-height: 1.6;
}

/* Case Examples */
.examples-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.example-card {
    background: #f8f9fc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.example-title {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.example-before {
    background: #fff3cd;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.example-after {
    background: #d4edda;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.example-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Notifications */
.notification {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.notification.info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.notification i {
    font-size: 1.2rem;
}

.notification-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
}

.notification-close:hover {
    opacity: 1;
}

/* Export/Import Styles */
.data-management {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.data-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    padding: 0.875rem 2rem;
    background: #6c757d;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.file-input-label:hover {
    background: #545b62;
    transform: translateY(-2px);
}

/* Text Analysis */
.analysis-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.analysis-card {
    background: #f8f9fc;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.analysis-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.analysis-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.analysis-description {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-features {
        gap: 1.5rem;
        flex-direction: column;
        align-items: center;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mode-tab {
        text-align: center;
    }
    
    .conversion-results {
        grid-template-columns: 1fr;
    }
    
    .advanced-grid {
        grid-template-columns: 1fr;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        text-align: center;
        justify-content: center;
    }
    
    .history-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .history-actions {
        align-self: flex-end;
    }
    
    .data-actions {
        flex-direction: column;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 1.5rem 0.5rem;
    }
    
    .converter-section,
    .templates-section,
    .history-section,
    .examples-section,
    .analysis-section {
        padding: 1.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .text-input {
        min-height: 150px;
    }
    
    .input-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .converter-section,
    .templates-section,
    .history-section,
    .examples-section,
    .analysis-section,
    .feature-card {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .text-input,
    .search-input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .text-input:focus,
    .search-input:focus {
        background: #2d3748;
        border-color: #667eea;
    }
    
    .options-section,
    .advanced-section,
    .option-item,
    .template-card,
    .example-card,
    .analysis-card,
    .conversion-card,
    .advanced-card {
        background: #4a5568;
        border-color: #718096;
    }
    
    .conversion-result,
    .template-sample,
    .example-before,
    .example-after {
        background: #2d3748;
        border-color: #718096;
    }
    
    .input-stats {
        background: #4a5568;
    }
    
    .how-to-use {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    .steps-list li {
        background: #4a5568;
        border-color: #718096;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn:focus,
.text-input:focus,
.search-input:focus,
.mode-tab:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        border: 2px solid #fff;
    }
    
    .text-input,
    .search-input {
        border-width: 3px;
    }
}
