:root {
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #e94560;
    --text-light: #fff;
    --highlight: #f9a826;
    --success: #4cd137;
    --slot-bg: #2a2a4a;
    --slot-border: #4a4a6a;
    --swap-hover: #00d2d3;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-light);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    text-align: center;
    margin-bottom: 50px;
    margin-top: 20px;
    transition: all 0.5s ease;
    margin-left: auto;
    margin-right: auto;
}

header.minimized {
    margin-bottom: 10px;
    margin-top: 5px;
}

header.minimized h1 {
    font-size: 2em;
}

header.minimized .subtitle {
    display: none;
}

h1 {
    font-size: 3.5em;
    color: var(--highlight);
    text-shadow: 0 0 10px rgba(249, 168, 38, 0.3);
    margin: 0 0 10px 0;
    letter-spacing: 2px;
    transition: all 0.5s ease;
}

.subtitle {
    color: #a0a0b0;
    font-size: 1.2em;
    max-height: 50px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.5s ease;
    margin: 10px 0;
}

header.minimized .subtitle {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

.choices-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.choices-container.minimized {
    gap: 15px;
    margin-bottom: 30px;
    max-width: 1000px; /* تم زيادة المساحة لمنع نزول اللوتر للسطر الثاني */
}

.choice-card {
    background-color: var(--card-bg);
    border: 2px solid #2a2a4a;
    border-radius: 15px;
    padding: 25px;
    width: 260px;
    text-align: center;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.choices-container.minimized .choice-card {
    width: 70px;
    padding: 8px;
    border-radius: 12px;
    border-width: 1px;
}

.choice-card h2 {
    color: var(--text-light);
    margin-top: 0;
    font-size: 1.6em;
    margin-bottom: 20px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.choices-container.minimized .choice-card h2 {
    font-size: 0;
    margin-bottom: 0;
    opacity: 0;
    height: 0;
}

.image-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    display: inline-block;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.choices-container.minimized .image-wrapper {
    padding: 4px;
    border-radius: 6px;
    background: transparent;
}

.choice-card img {
    width: 100%;
    max-width: 160px;
    height: auto;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
}

.choices-container.minimized .choice-card img {
    max-width: 45px;
}

.choices-container.minimized .unfilled-badge {
    font-size: 0;
    padding: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    top: 5px;
    right: 5px;
    transform: none;
}

.choice-card:hover {
    transform: translateY(-10px);
    border-color: var(--highlight);
    box-shadow: 0 15px 30px rgba(249, 168, 38, 0.2);
}

.choice-card:hover img {
    transform: scale(1.15) rotate(2deg);
    filter: drop-shadow(0 0 15px rgba(249, 168, 38, 0.5));
}

.choice-card.selected {
    border-color: var(--success);
    box-shadow: 0 0 25px rgba(76, 209, 55, 0.3);
}

.choice-card.selected h2 {
    color: var(--success);
}

.choice-card.selected img {
    filter: drop-shadow(0 0 20px rgba(76, 209, 55, 0.6));
}

#dynamic-app-container {
    display: none;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease forwards;
}

#dynamic-app-container.visible {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
}

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

.panel {
    background: rgba(22, 33, 62, 0.6);
    border: 2px solid var(--slot-border);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.side-panel {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    min-height: 500px;
}

.center-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 400px;
}

.panel-title {
    color: var(--highlight);
    text-align: center;
    margin-top: 0;
    font-size: 1.5em;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--slot-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(4, 100px);
    gap: 15px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    margin-bottom: 30px;
    justify-content: center;
}

.equipment-slot {
    width: 100px;
    height: 100px;
    background-color: var(--slot-bg);
    border: 3px solid var(--slot-border);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.equipment-slot:hover, .equipment-slot.active {
    border-color: var(--highlight);
    box-shadow: 0 0 15px rgba(249, 168, 38, 0.4);
    transform: scale(1.05);
}

.equipment-slot img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.slot-bag { grid-column: 1; grid-row: 1; }
.slot-head { grid-column: 2; grid-row: 1; }
.slot-cape { grid-column: 3; grid-row: 1; }
.slot-mainhand { grid-column: 1; grid-row: 2; }
.slot-armor { grid-column: 2; grid-row: 2; }
.slot-offhand { grid-column: 3; grid-row: 2; }
.slot-potion { grid-column: 1; grid-row: 3; }
.slot-shoes { grid-column: 2; grid-row: 3; }
.slot-food { grid-column: 3; grid-row: 3; }
.slot-mount { grid-column: 2; grid-row: 4; }

.swaps-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 20px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

.swaps-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.swap-slot {
    width: 80px;
    height: 80px;
    background-color: var(--slot-bg);
    border: 3px dashed var(--slot-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.swap-slot:hover {
    border-color: var(--swap-hover);
    border-style: solid;
    box-shadow: 0 0 15px rgba(0, 210, 211, 0.5), inset 0 0 15px rgba(0, 210, 211, 0.2);
    transform: translateY(-5px);
}

.swap-slot img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.loot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.loot-list li {
    padding: 15px;
    margin-bottom: 12px;
    background: rgba(0,0,0,0.3);
    border-left: 4px solid var(--highlight);
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: default;
    font-weight: bold;
    color: #e0e0e0;
}

.loot-list li:hover {
    background: rgba(249, 168, 38, 0.1);
    transform: translateX(5px);
}

.loot-list li.rare { border-left-color: #9b59b6; }
.loot-list li.legendary { border-left-color: #f1c40f; }
.loot-list li.energy { border-left-color: #00d2d3; }

.skills-placeholder {
    color: #a0a0b0;
    text-align: center;
    margin-top: 100px;
    font-style: italic;
    font-size: 1.1em;
}

.skill-item-display {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--slot-border);
    animation: fadeIn 0.3s ease;
}

.skill-item-display img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--highlight);
}

.skill-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.skill-desc {
    font-size: 0.8em;
    color: #dcdcdc;
    margin-top: 5px;
    line-height: 1.3;
}

.skill-name {
    color: var(--highlight);
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.skill-type {
    color: #a0a0b0;
    font-size: 0.85em;
}

.tooltip {
    position: absolute;
    background: rgba(22, 33, 62, 0.95);
    border: 1px solid var(--highlight);
    color: var(--text-light);
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.tooltip.visible {
    opacity: 1;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.info-toast {
    position: fixed;
    top: 30px;
    right: -350px;
    background: var(--highlight);
    color: #1a1a2e;
    padding: 15px 25px;
    border-radius: 10px 0 0 10px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2000;
    box-shadow: -5px 5px 15px rgba(0,0,0,0.3);
    border-left: 5px solid #d48a1c;
}

.info-toast.visible {
    right: 0;
    opacity: 1;
}
.spell-slots-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.spell-slot-row {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 8px;
}

.slot-label {
    width: 30px;
    font-weight: bold;
    color: var(--highlight);
    text-align: center;
    font-size: 1.2em;
}

.spell-choices {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    border-left: 1px solid #4a4a6a;
    padding-left: 15px;
    margin-left: 5px;
}

.spell-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    filter: grayscale(80%) brightness(0.6);
}

.spell-icon:hover {
    filter: grayscale(0%) brightness(1.1);
    transform: scale(1.1);
}

.spell-icon.selected {
    filter: grayscale(0%) brightness(1);
    border-color: var(--success);
    box-shadow: 0 0 12px rgba(76, 209, 55, 0.4);
}

.spell-detail-box {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    border-left: 4px solid var(--highlight);
    min-height: 110px;
    animation: fadeIn 0.3s ease;
}

.choice-card.locked {
    filter: grayscale(80%) opacity(0.7);
    cursor: not-allowed;
    border-color: #2a2a4a;
}

.choice-card.locked:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.choice-card.locked:hover img {
    transform: none;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
}

.unfilled-badge {
    position: absolute;
    top: 10px;
    right: -35px;
    background: #e74c3c;
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    padding: 5px 40px;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    letter-spacing: 1px;
}

.spell-media-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--slot-border);
}

.spell-video-wrapper {
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--highlight);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.spell-video-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}
