/* Base styles - typography, layout, core elements */

body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #eef2f6;
    margin: 0;
    color: #333;
    line-height: 1.6;
}

#app {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 800px;
    width: 90%;
    transition: max-width 0.3s ease, width 0.3s ease;
}

#app.expanded {
    max-width: 75vw;
    width: 75vw;
}

/* App header with info icon */
.app-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.title-container {
    text-align: center;
}

h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 5em;
    line-height: 1.1;
    position: relative;
    white-space: nowrap;
    font-family: 'Fira Sans', sans-serif;
    font-weight: 700;
}

.subtitle {
    margin: 0;
    margin-top: -0.3em;
    font-size: 1.25em;
    color: #666;
    font-style: italic;
    line-height: 1.2;
    font-weight: normal;
    letter-spacing: 0.02em;
    font-family: 'Fira Sans', sans-serif;
}

.app-info-icon {
    font-size: 0.25em;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
    user-select: none;
    position: absolute;
    top: 0.1em;
    left: calc(50% + 6em);
    vertical-align: super;
    white-space: nowrap;
    pointer-events: auto;
    z-index: 10;
    font-family: 'Roboto', sans-serif;
}

.app-info-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Unified Info Panel System */
.info-panel {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f1f3f4;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9em;
    line-height: 1.5;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-align: left;
    position: relative;
    z-index: 10;
}

.info-panel .info-panel-content {
    color: #374151;
}

.info-panel .info-panel-content h4 {
    color: #374151;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1em;
}

.info-panel .info-panel-content h5 {
    color: #4b5563;
    margin-bottom: 0.5rem;
    font-size: 0.95em;
    font-weight: 600;
}

.info-panel .info-panel-content p {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.info-panel .info-panel-content ul {
    color: #6b7280;
    margin: 0 0 1rem 1.2rem;
}

.info-panel .info-panel-content li {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.info-panel .info-section {
    margin-bottom: 1rem;
}

.info-panel .info-section:last-child {
    margin-bottom: 0;
}

/* Dynamic info panels */
.dynamic-info-panel {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Static info panels (existing HTML panels) */
.app-info-panel {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    text-align: left;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.info-header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.info-header h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.4em;
    flex: 1;
    min-width: 250px;
}

.info-animation {
    margin-top: 2rem;
    text-align: center;
    width: 100%;
}

.info-animation video {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
    background-color: white;
}

.info-body {
    display: grid;
    gap: 1.5rem;
}

.info-section {
    margin-bottom: 1rem;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h4 {
    color: #34495e;
    margin-bottom: 0.5rem;
    font-size: 1.1em;
    font-weight: 600;
}

.info-section p {
    color: #555;
    margin: 0;
    line-height: 1.5;
}

.info-section ol {
    color: #555;
    margin: 0;
    padding-left: 1.5rem;
}

.info-section li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.info-section li:last-child {
    margin-bottom: 0;
}

.info-section code {
    background-color: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.debug-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid #007bff;
    transition: all 0.2s ease;
}

.debug-link:hover {
    background-color: #007bff;
    color: white;
    text-decoration: none;
}

@media (max-width: 768px) {
    .info-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .info-animation video {
        width: 95%;
        height: auto;
    }
    
    .app-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #app.expanded {
        max-width: 95vw;
        width: 95vw;
    }
}

/* Export help trigger styles */
.export-help-trigger {
    font-size: 0.85em;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
    user-select: none;
    font-weight: normal;
    color: #6b7280;
    margin-left: 0.5rem;
}

.export-help-trigger:hover {
    opacity: 1;
    transform: scale(1.05);
    color: #4b5563;
}

/* Export help section styles */
.export-help-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f1f3f4;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.export-help-section h5 {
    color: #4b5563;
    margin-bottom: 0.75rem;
    font-size: 1em;
    font-weight: 600;
}

.export-instructions {
    margin-top: 0.5rem;
}

.export-instructions ol {
    color: #6b7280;
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

.export-instructions li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.export-instructions li:last-child {
    margin-bottom: 0;
}

.export-screenshots {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.export-screenshot {
    border-radius: 6px;
    border: 1px solid #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    align-self: flex-start;
}

@media (max-width: 768px) {
    .export-screenshots {
        flex-direction: column;
        align-items: center;
    }
}

#status-log {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 1.5rem;
    text-align: left;
    font-size: 0.95em;
    color: #555;
}

#setup-area, #column-selection-area, #sorting-area, #results-area {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

#setup-area p, #column-selection-area p {
    font-size: 1.1em;
    margin-bottom: 1rem;
}

/* Form elements */
input[type="file"] {
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 5px;
    margin-right: 10px;
}

/* Button styles */
button {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 5px;
}

button:hover {
    background-color: #357ABD;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* Specific button styles */
#equal-rank-area {
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#equal-rank-area .info-icon {
    position: absolute;
    left: calc(50% + 120px);
    top: 50%;
    transform: translateY(-50%);
}

#equal-rank-button {
    background-color: #f39c12;
    font-size: 1.1em;
    padding: 15px 30px;
}

#equal-rank-button:hover {
    background-color: #e67e22;
}

#action-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

#undo-button {
    background-color: #6c757d;
    order: -1;
}

#undo-button:hover:not(:disabled) {
    background-color: #5a6268;
}

#undo-button:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Comparison area layout */
#comparison-area {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 2.5rem 0;
    flex-wrap: nowrap;
    align-items: flex-start;
}