/* RetroAchievements Platform Mapping Styles */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 160px 20px 20px 20px; /* Top, Right, Bottom, Left */
}

.page-header {
    margin-bottom: 30px;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5em;
    color: var(--heading-color, #303d4e);
    margin: 0 0 10px 0;
}

.page-header h1 strong {
    color: var(--accent-color, #3498db);
}

.subtitle {
    font-size: 1.1em;
    color: var(--subtle-text-color, #666);
    margin: 0;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-background, #fff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--accent-color, #3498db);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: var(--subtle-text-color, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Action Section */
.action-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

/* Buttons */
.btn-primary {
    background: var(--button-primary-bg, #3498db);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--button-primary-hover, #2980b9);
}

.btn-secondary {
    background: var(--button-secondary-bg, #95a5a6);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: var(--button-secondary-hover, #7f8c8d);
}

.btn-edit {
    background: var(--button-edit-bg, #f39c12);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 5px;
    text-decoration: none;
    display: inline-block;
}

.btn-edit:hover {
    background: var(--button-edit-hover, #e67e22);
    color: white;
}

.btn-delete {
    background: var(--button-delete-bg, #e74c3c);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete:hover {
    background: var(--button-delete-hover, #c0392b);
}

/* Table Styles */
.mappings-table {
    background: var(--card-background, #fff);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hidden-column {
    display: none;
}

.mappings-table table {
    width: 100%;
    border-collapse: collapse;
}

.mappings-table thead {
    background: var(--table-header-bg, #f8f9fa);
}

.mappings-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--heading-color, #303d4e);
    border-bottom: 2px solid var(--border-color, #e0e0e0);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mappings-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    color: var(--text-color, #333);
}

.mappings-table tbody tr {
    transition: background 0.2s;
}

.mappings-table tbody tr:hover {
    background: var(--table-row-hover, #f8f9fa);
}

.platform-name {
    font-weight: 600;
    color: var(--accent-color, #3498db);
}

.actions-cell {
    white-space: nowrap;
}

.no-results {
    text-align: center;
    color: var(--subtle-text-color, #999);
    font-style: italic;
    padding: 40px !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--card-background, #fff);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--heading-color, #303d4e);
    font-size: 1.5em;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: var(--subtle-text-color, #999);
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--text-color, #333);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--heading-color, #303d4e);
    font-size: 0.95em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--input-background, #fff);
    color: var(--text-color, #333);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color, #3498db);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input:disabled {
    background: var(--disabled-background, #f5f5f5);
    cursor: not-allowed;
    color: var(--subtle-text-color, #999);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2em;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .mappings-table {
        overflow-x: auto;
    }
    
    .mappings-table table {
        min-width: 600px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .action-section {
        justify-content: center;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --card-background: #1e1e1e;
        --heading-color: #e0e0e0;
        --text-color: #d0d0d0;
        --subtle-text-color: #888;
        --border-color: #333;
        --table-header-bg: #2a2a2a;
        --table-row-hover: #2a2a2a;
        --input-background: #2a2a2a;
        --disabled-background: #333;
    }
}