/* Palindrome Checker Styles */

/* Box Sizing Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Page Layout */
.tool-page {
    min-height: calc(100vh - 120px);
    background: #f8fafc;
    padding-bottom: 40px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Main Container */
.tool-page .container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='m30 30 15-15v30zM0 30l15-15v30z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 16px;
    border-radius: 25px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.hero-visual {
    position: relative;
    z-index: 2;
    text-align: center;
}

.palindrome-demo {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(20px);
    margin-bottom: 30px;
}

.demo-text {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin: 10px 0;
    letter-spacing: 3px;
}

.demo-text.original {
    color: #a8e6cf;
}

.demo-text.reversed {
    color: #ffd93d;
}

.demo-arrow {
    margin: 20px 0;
    font-size: 2rem;
    color: white;
    animation: rotate 2s infinite linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.demo-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #a8e6cf;
    margin-top: 20px;
}

.demo-examples {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.demo-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Tool Tabs */
.tool-tabs {
    margin: 40px 0;
    width: 100%;
}

/* Main Content Container */
.tool-page .container {
    padding-bottom: 60px;
    max-width: 1200px;
    width: 100%;
}

.tab-nav {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 16px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Tab Content */
.tab-content {
    min-height: 600px;
    width: 100%;
}

.tab-pane {
    display: none;
    min-height: 500px;
    padding: 20px 0;
    width: 100%;
}

.tab-pane.active {
    display: block;
}

/* Main Tab Layout */
.tab-pane .row {
    margin: 0;
    width: 100%;
}

.tab-pane .col-lg-4,
.tab-pane .col-lg-8 {
    padding: 0 15px;
    width: 100%;
    max-width: 100%;
}

/* Tool Cards */
.tool-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border: 1px solid #f1f5f9;
    height: fit-content;
    width: 100%;
    max-width: 100%;
}

.tool-card h3 {
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.tool-card h3 i {
    color: #667eea;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    width: 100%;
}

.form-control {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

/* Options Group */
.options-group {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.options-group h5 {
    margin-bottom: 15px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.option-item {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    width: 100%;
    box-sizing: border-box;
}

.option-item:last-child {
    margin-bottom: 0;
}

.option-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.option-item label {
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    margin-bottom: 4px;
}

.option-item small {
    display: block;
    color: #6b7280;
    margin-top: 4px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-outline-secondary {
    background: transparent;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.btn-outline-secondary:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-outline-primary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
}

.btn-outline-success {
    background: transparent;
    color: #059669;
    border: 2px solid #059669;
}

.btn-outline-success:hover {
    background: #059669;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-outline-info {
    background: transparent;
    color: #0891b2;
    border: 2px solid #0891b2;
}

.btn-outline-info:hover {
    background: #0891b2;
    color: white;
}

.btn-outline-danger {
    background: transparent;
    color: #dc2626;
    border: 2px solid #dc2626;
}

.btn-outline-danger:hover {
    background: #dc2626;
    color: white;
}

/* Result Section */
.result-section {
    background: white;
    border-radius: 16px;
    border: 2px solid #e5e7eb;
    margin-top: 25px;
    overflow: hidden;
}

.result-section.success {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.result-section.error {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
}

.result-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.result-icon.success {
    color: #10b981;
}

.result-icon.error {
    color: #ef4444;
}

.result-content h4 {
    margin: 0 0 8px 0;
    font-weight: 700;
    font-size: 1.5rem;
}

.result-content p {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #374151;
}

.result-details {
    font-size: 0.9rem;
    color: #6b7280;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
}

.processing-steps {
    padding: 0 25px 25px;
}

.processing-steps h5 {
    margin-bottom: 15px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.steps-content {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.step-item:last-child {
    margin-bottom: 0;
}

.step-number {
    background: #667eea;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.result-actions {
    padding: 0 25px 25px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Analysis Panel */
.analysis-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* Quick Examples */
.quick-examples {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.example-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.example-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Batch Options */
.batch-options {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

.batch-options h5 {
    margin-bottom: 15px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

/* Batch Results */
.batch-results {
    margin-top: 30px;
}

.results-header {
    margin-bottom: 20px;
}

.results-header h4 {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-summary {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 15px;
    color: #1e40af;
    font-weight: 500;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-result-item {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: white;
}

.batch-result-item.palindrome {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border-color: #10b981;
}

.batch-result-item.not-palindrome {
    background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
    border-color: #ef4444;
}

.batch-result-content {
    flex: 1;
}

.batch-result-text {
    font-weight: 600;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

.batch-result-details {
    font-size: 0.875rem;
    color: #6b7280;
}

.batch-result-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.batch-result-badge.palindrome {
    background: #10b981;
    color: white;
}

.batch-result-badge.not-palindrome {
    background: #ef4444;
    color: white;
}

/* Examples Grid */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.example-category {
    background: #f8fafc;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #e2e8f0;
}

.example-category h4 {
    margin-bottom: 20px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.example-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.example-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.example-text {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-family: 'Courier New', monospace;
}

.example-desc {
    font-size: 0.875rem;
    color: #6b7280;
}

/* History */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 10px;
    color: #374151;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-content {
    flex: 1;
}

.history-text {
    font-weight: 600;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
}

.history-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.history-badge.palindrome {
    background: #dcfce7;
    color: #166534;
}

.history-badge.not-palindrome {
    background: #fee2e2;
    color: #991b1b;
}

/* Guide Content */
.guide-content {
    max-width: none;
}

.guide-section {
    margin-bottom: 40px;
}

.guide-section h4 {
    color: #1e293b;
    margin-bottom: 15px;
    font-weight: 700;
}

.guide-section p {
    color: #374151;
    line-height: 1.7;
    margin-bottom: 15px;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.type-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.type-item h5 {
    color: #667eea;
    margin-bottom: 10px;
    font-weight: 600;
}

.type-item p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.type-item .examples {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.process-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h5 {
    margin-bottom: 8px;
    color: #1e293b;
    font-weight: 600;
}

.step-content p {
    margin: 0;
    color: #6b7280;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.feature i {
    color: #667eea;
    font-size: 1.5rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.feature h5 {
    margin-bottom: 8px;
    color: #1e293b;
    font-weight: 600;
}

.feature p {
    margin: 0;
    color: #6b7280;
}

.tips-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f0fdf4;
    border-radius: 10px;
    border: 1px solid #bbf7d0;
}

.tip i {
    color: #059669;
    margin-top: 2px;
    flex-shrink: 0;
}

.tip p {
    margin: 0;
    color: #065f46;
    font-size: 0.9rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.faq-item h5 {
    color: #1e293b;
    margin-bottom: 10px;
    font-weight: 600;
}

.faq-item p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-page {
        background: white;
        padding: 0;
        width: 100vw;
        overflow-x: hidden;
    }
    
    .tool-page .container {
        padding: 0 10px;
        max-width: 100%;
        width: 100%;
    }
    
    .hero-section {
        padding: 60px 0;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        width: 100vw;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .tab-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .tab-btn {
        min-width: auto;
        width: 100%;
        justify-content: flex-start;
    }
    
    .tool-card {
        padding: 20px;
        margin-bottom: 20px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .form-control {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .analysis-stats {
        grid-template-columns: 1fr;
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .tab-pane .col-lg-4,
    .tab-pane .col-lg-8 {
        width: 100%;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-features {
        justify-content: center;
    }
    
    .tab-nav {
        flex-direction: column;
    }
    
    .tab-btn {
        min-width: auto;
    }
    
    .analysis-stats {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .result-header {
        flex-direction: column;
        text-align: center;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .type-grid {
        grid-template-columns: 1fr;
    }
    
    .process-steps .step {
        flex-direction: column;
        text-align: center;
    }
}
