/* ============================================================
   Aethermoor - UI Component Styles
   Reusable UI elements: buttons, inputs, dropdowns, modals, tabs, progress bars
   ============================================================ */

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-gold {
    background: linear-gradient(180deg, #b8960f, #ffd700);
    color: #1a0a2e;
}

.btn-gold:hover:not(:disabled) {
    background: linear-gradient(180deg, #ffd700, #ffe44d);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.btn-purple {
    background: linear-gradient(180deg, #6b1f6f, #4a0e4e);
    color: #e0d0f0;
    border: 1px solid #6b1f6f;
}

.btn-purple:hover:not(:disabled) {
    background: linear-gradient(180deg, #7d2a7d, #5a155e);
    box-shadow: 0 0 15px rgba(74, 14, 78, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid #4a0e4e;
    color: #e0d0f0;
}

.btn-outline:hover:not(:disabled) {
    border-color: #ffd700;
    color: #ffd700;
}

.btn-danger {
    background: linear-gradient(180deg, #a93226, #c0392b);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(180deg, #c0392b, #e74c3c);
}

.btn-success {
    background: linear-gradient(180deg, #27ae60, #2ecc71);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(180deg, #2ecc71, #4ade80);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* === Input Fields === */
.input {
    width: 100%;
    padding: 0.6rem 1rem;
    background: #2a1540;
    border: 1px solid #4a0e4e;
    border-radius: 6px;
    color: #e0d0f0;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.15);
}

.input::placeholder {
    color: #a090b0;
}

.input.error {
    border-color: #c0392b;
}

.input.success {
    border-color: #2ecc71;
}

.input-group {
    position: relative;
    margin-bottom: 0.75rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    color: #a090b0;
}

.input-group .input-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #a090b0;
    pointer-events: none;
}

.input-with-icon {
    padding-right: 2.5rem;
}

textarea.input {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a090b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 2rem;
}

/* === Dropdowns === */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: rgba(26, 10, 46, 0.97);
    border: 1px solid #4a0e4e;
    border-radius: 6px;
    padding: 4px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    color: #e0d0f0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.1s;
}

.dropdown-item:hover {
    background: #4a0e4e;
    color: #ffd700;
}

.dropdown-separator {
    height: 1px;
    background: #4a0e4e;
    margin: 4px 0;
}

.dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #a090b0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Modals === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.modal-box {
    background: rgba(26, 10, 46, 0.97);
    border: 2px solid #ffd700;
    border-radius: 12px;
    padding: 2rem;
    width: 450px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-box .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #4a0e4e;
}

.modal-box .modal-header h2 {
    color: #ffd700;
    font-family: Georgia, serif;
    font-size: 1.25rem;
}

.modal-box .modal-close {
    background: none;
    border: none;
    color: #a090b0;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.15s;
}

.modal-box .modal-close:hover {
    color: #ffd700;
}

.modal-box .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #4a0e4e;
}

/* === Tabs === */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #4a0e4e;
    margin-bottom: 1rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #a090b0;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.tab:hover {
    color: #e0d0f0;
}

.tab.active {
    color: #ffd700;
    border-bottom-color: #ffd700;
}

.tab-content {
    display: none;
}

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

/* === Progress Bars === */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #2a1540;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
    position: relative;
}

.progress-bar .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 4px 4px 0 0;
}

.progress-bar.hp .progress-fill { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.progress-bar.mana .progress-fill { background: linear-gradient(90deg, #2980b9, #3498db); }
.progress-bar.xp .progress-fill { background: linear-gradient(90deg, #8e44ad, #9b59b6); }
.progress-bar.loyalty .progress-fill { background: linear-gradient(90deg, #e67e22, #f39c12); }
.progress-bar.proficiency .progress-fill { background: linear-gradient(90deg, #b8960f, #ffd700); }
.progress-bar.reputation .progress-fill { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.progress-bar.challenge .progress-fill { background: linear-gradient(90deg, #4a0e4e, #6b1f6f); }

.progress-bar .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* === Cards === */
.card {
    background: rgba(26, 10, 46, 0.9);
    border: 1px solid #4a0e4e;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s;
}

.card:hover {
    border-color: #6b1f6f;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-title {
    color: #ffd700;
    font-size: 0.95rem;
    font-weight: 600;
}

.card-body {
    color: #e0d0f0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #4a0e4e;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-common { background: #b0b0b0; color: #1a0a2e; }
.badge-magic { background: #4a90d9; color: #fff; }
.badge-rare { background: #ffd700; color: #1a0a2e; }
.badge-unique { background: #ff8c00; color: #fff; }
.badge-legendary { background: #a335ee; color: #fff; }
.badge-set { background: #00ff00; color: #1a0a2e; }

.badge-online { background: #2ecc71; color: #1a0a2e; }
.badge-offline { background: #808080; color: #fff; }
.badge-busy { background: #e74c3c; color: #fff; }

/* === Status Indicators === */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background: #2ecc71; box-shadow: 0 0 4px #2ecc71; }
.status-dot.offline { background: #808080; }
.status-dot.away { background: #f39c12; }
.status-dot.dnd { background: #e74c3c; }

/* === Loading Spinner === */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #4a0e4e;
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Responsive === */
@media (max-width: 768px) {
    .modal-box {
        width: 95vw;
        padding: 1.5rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}
