/**
 * D&D AI RPG - Save/Load System Styles
 * Beautiful presentation for game state management
 */

/* ============================================================================
   SAVE/LOAD PANEL
   ============================================================================ */

.save-load-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1400px;
    height: 85vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #27ae60;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.save-load-panel.hidden {
    display: none;
}

/* ============================================================================
   HEADER
   ============================================================================ */

.save-load-header {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1e8449;
}

.save-load-header h2 {
    color: white;
    margin: 0;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.close-save-load-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.close-save-load-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============================================================================
   TABS
   ============================================================================ */

.save-load-tabs {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #34495e;
}

.save-load-tabs .tab-btn {
    background: rgba(39, 174, 96, 0.2);
    border: 2px solid #27ae60;
    color: #27ae60;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-load-tabs .tab-btn:hover {
    background: rgba(39, 174, 96, 0.3);
    border-color: #58d68d;
    transform: translateY(-2px);
}

.save-load-tabs .tab-btn.active {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border-color: #58d68d;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.tab-icon {
    font-size: 18px;
}

/* ============================================================================
   CONTENT
   ============================================================================ */

.save-load-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: rgba(0, 0, 0, 0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-description {
    color: #95a5a6;
    font-size: 14px;
    margin-bottom: 20px;
}

/* ============================================================================
   CURRENT GAME INFO
   ============================================================================ */

.current-game-info {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(46, 204, 113, 0.05));
    border: 2px solid #27ae60;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #27ae60;
    font-weight: bold;
    font-size: 14px;
}

.info-value {
    color: white;
    font-size: 14px;
}

/* ============================================================================
   SAVE SLOTS GRID
   ============================================================================ */

.save-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.save-slot {
    background: linear-gradient(135deg, rgba(52, 73, 94, 0.6), rgba(44, 62, 80, 0.6));
    border: 3px solid #34495e;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.save-slot:hover:not(.disabled) {
    border-color: #27ae60;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.save-slot.empty {
    background: rgba(0, 0, 0, 0.3);
    border-style: dashed;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.save-slot.empty.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.save-slot.quick-save {
    border-color: #f39c12;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.3);
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slot-number {
    color: #27ae60;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}

.save-slot.quick-save .slot-number {
    color: #f39c12;
}

.delete-slot-btn {
    background: rgba(231, 76, 60, 0.2);
    border: 2px solid #e74c3c;
    color: #e74c3c;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.delete-slot-btn:hover {
    background: rgba(231, 76, 60, 0.4);
    border-color: #ec7063;
    transform: scale(1.1);
}

.slot-empty {
    color: #7f8c8d;
    font-size: 16px;
    margin: 20px 0;
}

.slot-character {
    display: flex;
    gap: 15px;
    align-items: center;
}

.char-portrait {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.1), rgba(0,0,0,0.3));
    border: 3px solid #27ae60;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.save-slot.quick-save .char-portrait {
    border-color: #f39c12;
}

.char-icon {
    font-size: 40px;
}

.char-info {
    flex: 1;
}

.char-name {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.char-details {
    color: #95a5a6;
    font-size: 13px;
}

.slot-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #bdc3c7;
    font-size: 12px;
}

.meta-icon {
    color: #27ae60;
    font-size: 14px;
}

.save-slot-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.save-slot-btn:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.save-slot-btn.load {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.save-slot-btn.load:hover {
    background: linear-gradient(135deg, #5dade2, #3498db);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* ============================================================================
   QUICK SAVE/LOAD SECTION
   ============================================================================ */

.quick-save-section,
.quick-load-section {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #34495e;
    border-radius: 10px;
    padding: 20px;
}

.quick-save-btn,
.quick-load-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 15px;
}

.quick-save-btn:hover:not(:disabled),
.quick-load-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f5b041, #f39c12);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.4);
}

.quick-load-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.quick-load-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5dade2, #3498db);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.quick-save-btn:disabled,
.quick-load-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 20px;
}

.auto-save-toggle {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
}

.auto-save-toggle label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
}

.auto-save-toggle input[type="checkbox"] {
    accent-color: #27ae60;
    width: 18px;
    height: 18px;
}

.last-auto-save {
    color: #95a5a6;
    font-size: 12px;
    font-style: italic;
}

/* ============================================================================
   MANAGE SECTION
   ============================================================================ */

.manage-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.manage-btn {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3), rgba(41, 128, 185, 0.3));
    border: 2px solid #3498db;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.manage-btn:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.5), rgba(41, 128, 185, 0.5));
    border-color: #5dade2;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.manage-btn.danger {
    border-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3), rgba(192, 57, 43, 0.3));
}

.manage-btn.danger:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.5), rgba(192, 57, 43, 0.5));
    border-color: #ec7063;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.save-stats {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #34495e;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.save-stats h4 {
    color: #3498db;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #95a5a6;
    font-size: 14px;
}

.stat-value {
    color: #3498db;
    font-size: 14px;
    font-weight: bold;
}

.cloud-sync-section {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.05));
    border: 2px solid #3498db;
    border-radius: 10px;
    padding: 20px;
}

.cloud-sync-section h4 {
    color: #3498db;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.cloud-sync-section p {
    color: #95a5a6;
    font-size: 13px;
    margin-bottom: 15px;
}

.cloud-sync-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cloud-sync-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5dade2, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.cloud-sync-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1200px) {
    .save-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 1024px) {
    .save-load-panel {
        width: 95%;
        height: 90vh;
    }

    .save-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .manage-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .save-load-panel {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .save-load-header {
        padding: 15px 20px;
    }

    .save-load-header h2 {
        font-size: 18px;
    }

    .save-load-content {
        padding: 15px;
    }

    .save-slots-grid {
        grid-template-columns: 1fr;
    }

    .char-portrait {
        width: 60px;
        height: 60px;
    }

    .char-name {
        font-size: 16px;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

.save-load-panel:focus-within {
    outline: 3px solid #27ae60;
    outline-offset: -3px;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.save-slot {
    animation: slideIn 0.3s ease-out;
}
