/* XML Beautifier Modern Design - Glass Morphism & Split Layout */

/* Hero Section */
.beautifier-hero {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.beautifier-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="1000" height="1000" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.hero-badge i {
    margin-right: 0.5rem;
    color: #ffd700;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff 0%, #f0f8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.feature-item i {
    margin-right: 0.5rem;
    color: #10b981;
    font-size: 1.2rem;
}

.hero-visual {
    position: relative;
    z-index: 2;
}

.floating-elements {
    position: relative;
    height: 200px;
}

.floating-xml {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.8);
    animation: float 6s ease-in-out infinite;
}

.floating-brackets {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.6);
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Container */
.beautifier-container {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Modern Tab Navigation */
.tab-navigation {
    margin-bottom: 3rem;
}

.nav-tabs-custom {
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    border-radius: 25px;
    padding: 0.75rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    position: relative;
}

.nav-tabs-custom::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 27px;
    z-index: -1;
    opacity: 0.1;
}

.nav-link-custom {
    border: none;
    border-radius: 20px;
    padding: 1.25rem 2.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: #64748b;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 0.25rem;
    position: relative;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 140px;
    justify-content: center;
}

.nav-link-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.nav-link-custom:hover::before {
    left: 0;
}

.nav-link-custom:hover {
    color: #4338ca;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

.nav-link-custom.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.5);
    transform: translateY(-3px) scale(1.02);
    position: relative;
}

.nav-link-custom.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #6366f1;
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
}

.nav-link-custom i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-link-custom:hover i {
    transform: scale(1.1);
}

/* Panels */
.panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.input-panel {
    border-left: 4px solid #6366f1;
}

.output-panel {
    border-left: 4px solid #10b981;
}

.panel-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.output-panel .panel-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.panel-title h5 {
    margin: 0;
    font-weight: 700;
    color: #1f2937;
    font-size: 1.3rem;
}

.panel-title small {
    color: #6b7280;
    font-size: 0.9rem;
}

.panel-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #6366f1;
    line-height: 1;
}

.output-panel .stat-number {
    color: #10b981;
}

.stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-body {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.code-editor {
    flex: 1;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
    font-size: 14px;
    line-height: 1.6;
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transition: all 0.3s ease;
    resize: none;
    outline: none;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    min-height: 500px;
}

.code-editor:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), inset 0 2px 10px rgba(0, 0, 0, 0.05);
    background: white;
}

.output-panel .code-editor:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1), inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.panel-footer {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Action Panel */
.action-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    margin-top: 2rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn-gradient-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.btn-gradient-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
}

.btn-gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
    transition: all 0.3s ease;
}

.btn-gradient-warning:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.4);
}

.btn-gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.btn-gradient-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.4);
}

.btn-action {
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* XPath Search Section */
.xpath-search-section {
    max-width: 800px;
    margin: 0 auto;
}

.search-input-group {
    margin-bottom: 2rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    border: none;
    padding: 1.2rem 1.5rem;
    font-size: 1rem;
    background: transparent;
    outline: none;
    color: #1f2937;
}

.search-input::placeholder {
    color: #9ca3af;
}

.btn-search {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 1.2rem 1.5rem;
    border-radius: 0 15px 15px 0;
    transition: all 0.3s ease;
}

.btn-search:hover {
    background: linear-gradient(135deg, #5855eb 0%, #7c3aed 100%);
    transform: scale(1.05);
}

/* XPath Results */
.xpath-results-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.results-header {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.results-header h6 {
    margin: 0;
    color: #374151;
    font-weight: 600;
}

.xpath-results-list {
    padding: 2rem;
    max-height: 400px;
    overflow-y: auto;
}

.xpath-result-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.xpath-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* XPath Examples */
.xpath-examples {
    margin-top: 3rem;
}

.examples-title {
    text-align: center;
    color: #374151;
    font-weight: 600;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.example-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.example-code {
    display: block;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.example-desc {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Result Notifications */
.result-notification {
    text-align: center;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .beautifier-hero {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-features {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .feature-item {
        width: 100%;
        max-width: 300px;
    }

    .panel-header {
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .panel-stats {
        width: 100%;
        justify-content: space-around;
    }

    .panel-body {
        padding: 1.5rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-action {
        width: 100%;
        max-width: 300px;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .floating-xml,
    .floating-brackets {
        display: none;
    }
}

/* Dark Mode Styles */
.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e2e8f0;
}

.dark-mode .beautifier-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.dark-mode .hero-title {
    background: linear-gradient(45deg, #f8fafc 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark-mode .hero-subtitle,
.dark-mode .hero-features .feature-item {
    color: rgba(255, 255, 255, 0.9);
}

.dark-mode .hero-features .feature-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark-mode .tab-navigation .nav-tabs-custom {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .panel {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .panel-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .panel-icon {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.dark-mode .panel-title h5 {
    color: #f1f5f9;
}

.dark-mode .panel-title small {
    color: #94a3b8;
}

.dark-mode .stat-number {
    color: #6366f1;
}

.dark-mode .code-editor {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.dark-mode .code-editor:focus {
    border-color: #6366f1;
    background: #0f172a;
}

.dark-mode .action-panel {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .search-input-wrapper {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark-mode .search-input {
    background: transparent;
    color: #e2e8f0;
}

.dark-mode .search-input::placeholder {
    color: #64748b;
}

.dark-mode .example-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .example-code {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.dark-mode .example-desc {
    color: #cbd5e1;
}

.dark-mode .panel-footer {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Footer Actions */
.footer-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-actions .btn {
    min-width: 120px;
}

/* Toast Notifications */
.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 300px;
    max-width: 500px;
}

.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-left: 4px solid #34d399;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-left: 4px solid #f87171;
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-left: 4px solid #fbbf24;
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-left: 4px solid #60a5fa;
}

.toast-content i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-content span {
    flex: 1;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }

    .beautifier-container {
        padding: 1rem 0;
    }

    .action-panel {
        padding: 2rem 1rem;
    }

    .nav-tabs-custom {
        padding: 0.5rem;
    }

    .nav-link-custom {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .footer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-actions .btn {
        width: 100%;
        min-width: auto;
    }
}