/* Palindrome Checker Specific Styles */

.palindrome-checker-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Enhanced form styling */
.quick-action-btn {
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

.quick-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Tab system styling */
.tab-button {
    transition: all 0.2s ease-in-out;
    position: relative;
}

.tab-button.active {
    background-color: rgba(99, 102, 241, 0.05);
}

.tab-button:hover:not(.active) {
    background-color: rgba(156, 163, 175, 0.05);
}

.tab-content {
    min-height: 300px;
}

/* Palindrome cards */
.palindrome-card {
    transition: all 0.2s ease-in-out;
    border: 1px solid #e5e7eb;
}

.palindrome-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.palindrome-card .font-mono {
    word-break: break-all;
    line-height: 1.4;
}

/* Results grid responsive layout */
#resultsGrid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Loading animation enhancements */
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Status indicators */
.status-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.status-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.status-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.status-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Advanced options panel */
#advancedOptions {
    transition: all 0.3s ease-in-out;
    border: 1px solid #e5e7eb;
}

#advancedOptions.hidden {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
}

/* Character counter styling */
#charCount {
    font-variant-numeric: tabular-nums;
}

/* Real-time analysis cards */
.analysis-card {
    transition: all 0.2s ease-in-out;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.analysis-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Export buttons */
.export-btn {
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.export-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.export-btn:hover::before {
    width: 120%;
    height: 120%;
}

/* Pagination styling */
#pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

#pagination button:not(:disabled):hover {
    background-color: #f3f4f6;
    transform: translateY(-1px);
}

/* Toast notifications */
.toast-enter {
    transform: translateX(100%);
    opacity: 0;
}

.toast-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease-out;
}

.toast-exit {
    transform: translateX(0);
    opacity: 1;
}

.toast-exit-active {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in;
}

/* Responsive design enhancements */
@media (max-width: 768px) {
    .palindrome-checker-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h1 {
        font-size: 2.5rem !important;
    }

    .quick-action-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    #resultsGrid {
        grid-template-columns: 1fr;
    }

    .palindrome-card {
        margin-bottom: 1rem;
    }

    .tab-button {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .grid.grid-cols-2.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }

    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    .flex.flex-col.sm\\:flex-row {
        flex-direction: column !important;
    }

    .flex.flex-col.sm\\:flex-row > button {
        margin-bottom: 0.5rem;
    }
}

/* Focus states for accessibility */
.tab-button:focus,
.quick-action-btn:focus,
.palindrome-card:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

input:focus,
textarea:focus,
select:focus {
    ring-width: 2px;
    ring-color: #6366f1;
    border-color: #6366f1;
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .palindrome-checker-container {
        color-scheme: dark;
    }
}

/* Animation for result loading */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Gradient text effects */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Symmetry visualization */
.symmetry-visualization {
    font-family: "Courier New", monospace;
    letter-spacing: 0.1em;
    text-align: center;
    background: linear-gradient(90deg, #f0f9ff 0%, #e0e7ff 50%, #f0f9ff 100%);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e0e7ff;
}

.symmetry-char {
    display: inline-block;
    padding: 0.25rem;
    margin: 0.125rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.symmetry-char.match {
    background-color: #10b981;
    color: white;
}

.symmetry-char.mismatch {
    background-color: #ef4444;
    color: white;
}

.symmetry-char.center {
    background-color: #6366f1;
    color: white;
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Print styles */
@media print {
    .palindrome-checker-container {
        box-shadow: none !important;
    }

    .quick-action-btn,
    #loadingOverlay,
    #toastContainer {
        display: none !important;
    }

    .tab-content {
        display: block !important;
    }

    .palindrome-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}
