/* Multi-Item Comparison Dashboard - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 700;
}

header p {
    font-size: 1.4em;
    opacity: 0.9;
    font-weight: 300;
}

/* Comparison Type Selector */
.comparison-selector {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.comparison-selector h2 {
    text-align: center;
    margin-bottom: 40px;
    color: #333;
    font-size: 2.5em;
    font-weight: 600;
}

.comparison-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.comparison-option {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.comparison-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.comparison-option:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.comparison-option:hover::before {
    left: 100%;
}

.option-icon {
    font-size: 4em;
    margin-bottom: 20px;
    display: block;
}

.comparison-option h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.6em;
    font-weight: 600;
}

.comparison-option p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 1.1em;
}

.option-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 25px;
}

.feature {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: width 0.3s ease, height 0.3s ease;
    transform: translate(-50%, -50%);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

/* Comparison Dashboard */
.comparison-dashboard {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 30px 40px;
}

.dashboard-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-title h2 {
    font-size: 2.2em;
    font-weight: 600;
}

.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.add-item-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    max-width: 500px;
}

.add-item-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255,255,255,0.1);
    color: white;
    placeholder-color: rgba(255,255,255,0.7);
}

.add-item-form input::placeholder {
    color: rgba(255,255,255,0.7);
}

.add-item-form input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.8);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

.control-buttons {
    display: flex;
    gap: 12px;
}

/* Comparison Grid */
.comparison-grid {
    padding: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    min-height: 300px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #495057;
}

.empty-state p {
    font-size: 1.1em;
    margin-bottom: 30px;
    line-height: 1.6;
}

.quick-start {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.quick-start h4 {
    margin-bottom: 15px;
    color: #495057;
}

.quick-start-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Comparison Cards */
.comparison-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    animation: slideIn 0.5s ease;
}

.comparison-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.card-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.4em;
    font-weight: 600;
    text-transform: capitalize;
}

.remove-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: rgba(220, 53, 69, 0.8);
    transform: scale(1.1);
}

.card-content {
    padding: 25px;
}

.card-image {
    text-align: center;
    margin-bottom: 20px;
}

.card-image img {
    max-width: 120px;
    height: auto;
    border-radius: 8px;
}

.card-stats {
    display: grid;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.stat-label {
    font-weight: 600;
    color: #495057;
}

.stat-value {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1em;
}

.card-actions {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

/* Comparison Statistics */
.comparison-stats {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 30px 40px;
}

.comparison-stats h3 {
    margin-bottom: 25px;
    color: #495057;
    font-size: 1.8em;
}

.stats-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.stat-card h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.stat-card .stat-highlight {
    font-size: 1.8em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

/* Battle Mode */
.battle-mode {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 30px 40px;
    border-top: 1px solid #dee2e6;
}

.battle-mode h3 {
    margin-bottom: 25px;
    font-size: 1.8em;
    text-align: center;
}

.battle-arena {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
}

.battle-contestant {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 2px dashed rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.battle-contestant.selected {
    border-color: white;
    background: rgba(255,255,255,0.2);
}

.battle-vs {
    font-size: 2.5em;
    font-weight: bold;
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.battle-results {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    text-align: center;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content h3 {
    margin-bottom: 10px;
    color: #333;
}

#loadingStatus {
    color: #666;
}

/* Tutorial Section */
.tutorial-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.tutorial-section h2 {
    text-align: center;
    margin-bottom: 40px;
    color: #333;
    font-size: 2.5em;
}

.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.tutorial-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.step-number {
    background: #667eea;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.4em;
    flex-shrink: 0;
}

.step-content h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.4em;
}

.step-content p {
    color: #666;
    line-height: 1.6;
}

/* API Information */
.api-info {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.api-info h2 {
    text-align: center;
    margin-bottom: 40px;
    color: #333;
    font-size: 2.5em;
}

.api-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.api-card {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.api-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.api-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.api-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Code Examples */
.code-examples {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
}

.code-examples h2 {
    margin-bottom: 30px;
    color: #333;
    font-size: 2.5em;
    text-align: center;
}

.code-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 25px;
}

.code-tab {
    padding: 15px 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 16px;
}

.code-tab:hover {
    color: #667eea;
}

.code-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.code-panel {
    display: none;
}

.code-panel.active {
    display: block;
}

.code-panel h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4em;
}

.code-panel pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 25px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.code-panel code {
    font-family: inherit;
}

/* Form Elements */
input, select, textarea {
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2.5em;
    }

    .comparison-options {
        grid-template-columns: 1fr;
    }

    .dashboard-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .add-item-form {
        max-width: none;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .battle-arena {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .battle-vs {
        transform: rotate(90deg);
        margin: 20px 0;
    }

    .tutorial-grid {
        grid-template-columns: 1fr;
    }

    .tutorial-step {
        flex-direction: column;
        text-align: center;
    }

    .api-cards {
        grid-template-columns: 1fr;
    }

    .code-tabs {
        flex-direction: column;
    }

    .code-tab {
        text-align: center;
        border-bottom: 1px solid #e9ecef;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}