/**
 * D&D AI RPG - Difficulty System Styles
 * Settings panel and notifications
 */

/* Difficulty Panel */
.difficulty-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.difficulty-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #9b59b6;
    border-radius: 15px;
    max-width: 700px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.difficulty-header {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty-header h2 {
    margin: 0;
    color: white;
    font-size: 20px;
}

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

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

.difficulty-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

.difficulty-section {
    margin-bottom: 25px;
}

.difficulty-section h3 {
    color: #9b59b6;
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(155, 89, 182, 0.3);
}

/* Preset Grid */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.preset-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.preset-card:hover {
    background: rgba(155, 89, 182, 0.2);
    border-color: rgba(155, 89, 182, 0.5);
    transform: translateY(-2px);
}

.preset-card.active {
    background: rgba(155, 89, 182, 0.3);
    border-color: #9b59b6;
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.3);
}

.preset-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.preset-name {
    font-weight: bold;
    color: #ecf0f1;
    font-size: 14px;
    margin-bottom: 4px;
}

.preset-desc {
    font-size: 11px;
    color: #7f8c8d;
    line-height: 1.4;
}

/* Setting Groups */
.setting-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.setting-group h4 {
    color: #f39c12;
    font-size: 14px;
    margin: 0 0 12px 0;
}

/* Setting Rows */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.setting-row label {
    color: #bdc3c7;
    font-size: 13px;
}

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-container input[type="range"] {
    width: 120px;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-value {
    min-width: 50px;
    text-align: right;
    color: #9b59b6;
    font-weight: bold;
    font-size: 13px;
}

/* Dropdown */
.setting-row select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 6px;
    color: #ecf0f1;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    min-width: 150px;
}

.setting-row select:focus {
    outline: none;
    border-color: #9b59b6;
}

.setting-row select option {
    background: #1a1a2e;
    color: #ecf0f1;
}

/* Toggle Switch */
.toggle-switch {
    width: 50px;
    height: 26px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 13px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.toggle-switch.active {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active .toggle-knob {
    left: 27px;
}

/* Difficulty Notification */
.difficulty-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.95) 0%, rgba(142, 68, 173, 0.95) 100%);
    border: 2px solid #9b59b6;
    border-radius: 10px;
    padding: 12px 20px;
    color: white;
    z-index: 5000;
    animation: slideDown 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(155, 89, 182, 0.4);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.difficulty-notification.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.5s ease;
}

.difficulty-notification .notif-icon {
    font-size: 20px;
}

.difficulty-notification .notif-text {
    font-weight: bold;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 600px) {
    .difficulty-content {
        max-width: 98%;
    }

    .preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .slider-container {
        width: 100%;
    }

    .slider-container input[type="range"] {
        flex: 1;
    }

    .setting-row select {
        width: 100%;
    }
}
