/* 
 * Grammar Checker Tool - Professional CSS
 * Following html-converter tool standard with advanced features
 */

/* Hero Section Styling */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 3rem;
    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: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-feature i {
    font-size: 1.2rem;
}

/* Tool Container */
.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    gap: 0.5rem;
}

.mode-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mode-tab:hover {
    background: #f1f5f9;
    color: #475569;
}

.mode-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mode-tab i {
    font-size: 1.1rem;
}

/* 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); }
}

/* Grammar Checker Section */
.grammar-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.grammar-section h3 {
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.grammar-section h3 i {
    color: #667eea;
    font-size: 1.2rem;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.option-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}

.option-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #374151;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-label i {
    color: #667eea;
}

.option-select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

.option-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Check Options */
.check-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.check-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.check-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #667eea;
    cursor: pointer;
}

.check-item label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.check-item label i {
    color: #667eea;
}

/* Text Areas */
.text-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.text-input-group {
    display: flex;
    flex-direction: column;
}

.text-label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.text-label .label-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-label i {
    color: #667eea;
}

.text-counter {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.text-textarea {
    width: 100%;
    min-height: 350px;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: white;
}

.text-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.text-textarea.results {
    background: #f8fafc;
    color: #374151;
}

.text-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    min-width: 160px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-info {
    background: #0ea5e9;
    color: white;
}

.btn-info:hover {
    background: #0284c7;
    transform: translateY(-2px);
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading States */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: #667eea;
    font-weight: 500;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Statistics */
.grammar-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.grammar-stat {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Issues Section */
.issues-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.issues-section h3 {
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.issues-section h3 i {
    color: #667eea;
    font-size: 1.2rem;
}

.issues-list {
    max-height: 400px;
    overflow-y: auto;
}

.issue-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #dc3545;
    transition: all 0.3s ease;
}

.issue-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.issue-item.warning {
    border-left-color: #f59e0b;
}

.issue-item.suggestion {
    border-left-color: #0ea5e9;
}

.issue-item.error {
    border-left-color: #dc3545;
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.issue-type {
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.issue-type i {
    color: #667eea;
}

.issue-severity {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.severity-warning {
    background: #fefbf2;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.severity-suggestion {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.issue-text {
    background: #f1f5f9;
    padding: 0.875rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.issue-original {
    color: #dc2626;
    text-decoration: line-through;
    font-weight: 600;
}

.issue-arrow {
    color: #6b7280;
    margin: 0 0.5rem;
    font-weight: bold;
}

.issue-suggestion {
    color: #059669;
    font-weight: 600;
}

.issue-explanation {
    color: #374151;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-style: italic;
}

.suggestions-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.suggestion-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.suggestion-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* History Section */
.history-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.history-section h3 {
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.history-section h3 i {
    color: #667eea;
    font-size: 1.2rem;
}

.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    flex: 1;
    max-width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.history-item:hover {
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-timestamp {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.history-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #64748b;
    flex-wrap: wrap;
}

.history-preview {
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.history-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: #374151;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-btn:hover {
    background: #f3f4f6;
}

/* Quick Start Guide */
.quick-start {
    background: #f8fafc;
    border-radius: 16px;
    padding: 2rem;
    margin: 3rem 0;
    border: 1px solid #e2e8f0;
}

.quick-start h3 {
    color: #1e293b;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.quick-start h3 i {
    color: #667eea;
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.steps-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.steps-list li:hover {
    transform: translateY(-2px);
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
}

.step-text strong {
    color: #1e293b;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.step-text p {
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
}

.feature-card h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-weight: 600;
}

.feature-card p {
    color: #64748b;
    line-height: 1.6;
}

/* Languages Section */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.language-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.language-card.active {
    border-color: #667eea;
    background: #f8faff;
}

.language-flag {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.language-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.language-code {
    color: #64748b;
    font-size: 0.875rem;
}

/* Notification System */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #10b981;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.warning {
    border-left-color: #f59e0b;
}

.notification.info {
    border-left-color: #0ea5e9;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-features {
        gap: 1rem;
    }
    
    .hero-feature {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .mode-tab {
        min-width: auto;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .check-options {
        grid-template-columns: 1fr;
    }
    
    .text-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        min-width: auto;
    }
    
    .grammar-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .languages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps-list li {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
    
    .notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 0 0.5rem;
    }
    
    .grammar-section,
    .issues-section,
    .history-section {
        padding: 1.5rem;
    }
    
    .text-textarea {
        min-height: 250px;
        padding: 0.875rem;
        font-size: 0.875rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .quick-start {
        padding: 1.5rem;
    }
    
    .grammar-stats {
        grid-template-columns: 1fr;
    }
    
    .languages-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .hero-section,
    .tab-navigation,
    .button-group,
    .features-grid,
    .quick-start {
        display: none;
    }
    
    .tool-container {
        max-width: none;
        padding: 0;
    }
    
    .grammar-section,
    .issues-section {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .text-textarea {
        font-size: 12pt;
        line-height: 1.5;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .grammar-section,
    .issues-section,
    .history-section,
    .feature-card {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .option-group,
    .check-options {
        background: #111827;
        border-color: #374151;
    }
    
    .option-select,
    .text-textarea,
    .search-input {
        background: #111827;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .text-textarea.results {
        background: #111827;
    }
    
    .issue-item,
    .history-item {
        background: #111827;
        border-color: #374151;
    }
    
    .language-card {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .quick-start {
        background: #111827;
        border-color: #374151;
    }
}
