/* Text Formatter Tool Styles */

/* Tool Container - Full Page Layout */
.text-formatter-tool {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 0;
    margin: 0;
}

.tool-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header - Following established pattern */
.tool-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 1rem 0;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(20, 19, 19);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.tool-description {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Formatter Interface */
.formatter-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

/* Text Input Section - Following established pattern */
.text-input-section {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.input-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.paste-btn {
    background: var(--primary-color);
    color: var(--white);
}

.paste-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.clear-btn {
    background: #ef4444;
    color: var(--white);
}

.clear-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.textarea-container {
    position: relative;
}

#textInput {
    width: 100%;
    min-height: 400px;
    padding: 2rem;
    border: none;
    outline: none;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color);
    background: var(--white);
    resize: vertical;
}

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

.textarea-footer {
    padding: 1rem 2rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.quick-stats {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Formatting Options */
.formatting-options {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    max-height: 600px;
    overflow-y: auto;
}

.formatting-options h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2rem;
    text-align: center;
}

/* Option Groups */
.option-group {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.option-group:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.option-group h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.format-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white);
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.format-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.format-btn:active {
    transform: translateY(0);
    background: var(--primary-color);
    color: var(--white);
}

.format-btn i {
    font-size: 0.875rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.format-btn:hover i,
.format-btn:active i {
    color: inherit;
}

/* History Controls */
.history-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.history-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white);
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.history-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.history-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-light);
}

.history-info {
    flex: 1;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Tool Features - Following established pattern */
.tool-features {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 3rem;
}

.tool-features h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: var(--bg-light);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

/* Focus styles for accessibility */
#textInput:focus {
    box-shadow: 0 0 0 3px rgba(50, 146, 109, 0.1);
}

.textarea-container.focused {
    box-shadow: 0 0 0 2px var(--primary-color);
    border-radius: var(--border-radius-lg);
}

/* Hover effects */
.text-input-section:hover,
.formatting-options:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

/* Smooth transitions */
.text-input-section,
.formatting-options,
.tool-features {
    transition: var(--transition);
}

/* Custom scrollbar for formatting options */
.formatting-options::-webkit-scrollbar {
    width: 6px;
}

.formatting-options::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.formatting-options::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.formatting-options::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tool-container {
        max-width: 1200px;
        padding: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .formatter-interface {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .tool-header h1 {
        font-size: 2.25rem;
    }

    .formatting-options {
        max-height: none;
        overflow-y: visible;
    }

    .options-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .text-formatter-tool {
        padding: 0;
    }

    .tool-container {
        padding: 1rem;
    }

    .tool-header {
        margin-bottom: 1.5rem;
        padding: 0.5rem 0;
    }

    .tool-header h1 {
        font-size: 1.875rem;
    }

    .tool-description {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .input-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 1rem 1.5rem;
    }

    .header-actions {
        justify-content: center;
        gap: 0.5rem;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
    }

    #textInput {
        min-height: 300px;
        padding: 1.5rem;
        font-size: 1rem;
    }

    .formatting-options {
        padding: 1.5rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

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

    .history-controls {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .history-info {
        text-align: center;
        margin-top: 0.5rem;
    }

    .textarea-footer {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .tool-container {
        padding: 0.5rem;
    }

    .tool-header h1 {
        font-size: 1.625rem;
    }

    .tool-description {
        font-size: 0.9rem;
    }

    #textInput {
        padding: 1rem;
        min-height: 250px;
    }

    .input-header {
        padding: 1rem;
    }

    .formatting-options {
        padding: 1rem;
    }

    .format-btn {
        padding: 0.75rem;
        font-size: 0.8rem;
        gap: 0.375rem;
    }

    .format-btn i {
        font-size: 0.75rem;
    }

    .feature-item {
        padding: 1rem;
    }

    .feature-item i {
        font-size: 1.5rem;
    }

    .feature-item h3 {
        font-size: 0.9rem;
    }

    .feature-item p {
        font-size: 0.8rem;
    }

    .option-group h3 {
        font-size: 0.9rem;
    }

    .history-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .history-info {
        font-size: 0.8rem;
    }
}

/* Animation for format button clicks */
.format-btn.processing {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(0.95);
}

.format-btn.success {
    background: #10b981;
    color: var(--white);
    border-color: #10b981;
}

/* Loading state for buttons */
.format-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.format-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.5rem;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translateY(-50%);
}

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

/* Highlight effect for recently used buttons */
.format-btn.recently-used {
    background: rgba(50, 146, 109, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Enhanced focus styles */
.format-btn:focus,
.history-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Improved hover states for mobile */
@media (hover: hover) {
    .format-btn:hover {
        background: var(--bg-light);
        border-color: var(--primary-color);
        color: var(--primary-color);
        transform: translateY(-1px);
    }
}
