/**
 * Dark Realms - Component Styles
 * Przyciski, karty, modale, overlaye, wallet UI
 */

/* =============================================
   BUTTONS
============================================= */

/* Base button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Gold/Primary button */
.btn-gold,
.btn-primary {
    background: linear-gradient(135deg, #78590d, #a67c12);
    border-color: var(--gold);
    color: #f9edb8;
}

.btn-gold:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #a67c12, #d4a417);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212,164,23,0.4);
}

/* Secondary button */
.btn-secondary {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
    color: #ccc;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

/* Danger button */
.btn-danger {
    background: rgba(183, 28, 28, 0.8);
    border-color: var(--blood-bright);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(211, 47, 47, 0.9);
    transform: translateY(-2px);
}

/* Success button */
.btn-success {
    background: linear-gradient(135deg, #166534, #22c55e);
    border-color: #4ade80;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(74,222,128,0.4);
}

/* Small button */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.75rem;
}

/* Large button */
.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

/* =============================================
   RARITY BADGES
============================================= */
.rarity-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.rarity-common { 
    background: rgba(0,0,0,0.6); 
    color: #ccc; 
    border: 1px solid rgba(170,170,170,0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.rarity-uncommon { 
    background: rgba(0,0,0,0.6); 
    color: #4ade80; 
    border: 1px solid rgba(74,222,128,0.6);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.rarity-rare { 
    background: rgba(0,0,0,0.6); 
    color: #60a5fa; 
    border: 1px solid rgba(96,165,250,0.6);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.rarity-epic { 
    background: rgba(0,0,0,0.6); 
    color: #c084fc; 
    border: 1px solid rgba(192,132,252,0.6);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.rarity-legendary { 
    background: rgba(0,0,0,0.6); 
    color: #fbbf24; 
    border: 1px solid rgba(251,191,36,0.7);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    box-shadow: 0 0 8px rgba(251,191,36,0.3);
}

/* =============================================
   MODAL BACKDROP
============================================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.visible,
.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* =============================================
   MODAL PANEL
============================================= */
.modal-panel {
    background: linear-gradient(145deg, #14141c 0%, #0a0a0f 100%);
    border: 2px solid rgba(212,164,23,0.3);
    border-radius: 16px;
    box-shadow: 0 30px 100px rgba(0,0,0,0.8), 0 0 60px rgba(212,164,23,0.1);
    max-width: 95vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.visible .modal-panel,
.modal-backdrop.open .modal-panel {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--gold);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =============================================
   RESULT OVERLAYS (Victory/Defeat)
============================================= */
.result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.result-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.result-panel {
    background: linear-gradient(145deg, #14141c 0%, #0a0a0f 100%);
    border: 2px solid rgba(212,164,23,0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    transform: scale(0.8) translateY(30px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 30px 100px rgba(0,0,0,0.8);
}

.result-overlay.visible .result-panel {
    transform: scale(1) translateY(0);
}

.victory-panel {
    border-color: rgba(212,164,23,0.5);
    box-shadow: 0 30px 100px rgba(0,0,0,0.8), 0 0 60px rgba(212,164,23,0.15);
}

.defeat-panel {
    border-color: rgba(139,30,30,0.5);
    box-shadow: 0 30px 100px rgba(0,0,0,0.8), 0 0 60px rgba(139,30,30,0.15);
}

.result-header {
    text-align: center;
    padding: 30px 25px 20px;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin: 0;
    letter-spacing: 0.15em;
}

.result-title.victory {
    color: var(--gold);
    text-shadow: 0 0 40px rgba(212,164,23,0.5);
}

.result-title.defeat {
    color: var(--blood-bright);
    text-shadow: 0 0 40px rgba(139,30,30,0.5);
}

.result-subtitle {
    color: #888;
    font-size: 1.1rem;
    margin-top: 8px;
    font-style: italic;
}

.result-stats {
    padding: 15px 25px;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.stat-label {
    color: #888;
}

.stat-value {
    font-family: 'Cinzel', serif;
    color: #fff;
}

.stat-value.gold {
    color: var(--gold);
}

.stat-value.defeat-color {
    color: var(--blood-bright);
}

.result-buttons {
    display: flex;
    gap: 12px;
    padding: 20px 25px 25px;
    justify-content: center;
}

.result-button {
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.result-button.primary {
    background: linear-gradient(145deg, var(--gold) 0%, #a07c28 100%);
    color: #000;
}

.result-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212,164,23,0.4);
}

.result-button.secondary {
    background: rgba(255,255,255,0.1);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.2);
}

.result-button.secondary:hover {
    background: rgba(255,255,255,0.15);
}

/* =============================================
   LOOT SECTION
============================================= */
.loot-section {
    padding: 15px 25px;
}

.loot-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 12px;
    text-align: center;
}

.loot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.loot-item {
    width: 70px;
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    text-align: center;
    position: relative;
}

.loot-item.common { border-color: rgba(170,170,170,0.3); }
.loot-item.uncommon { border-color: rgba(74,222,128,0.3); }
.loot-item.rare { border-color: rgba(96,165,250,0.3); }
.loot-item.epic { border-color: rgba(192,132,252,0.3); }
.loot-item.legendary { 
    border-color: rgba(251,191,36,0.5);
    box-shadow: 0 0 10px rgba(251,191,36,0.2);
}

.loot-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.loot-name {
    font-size: 0.65rem;
    color: #aaa;
    line-height: 1.2;
}

.loot-quantity {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.6rem;
    background: rgba(0,0,0,0.7);
    padding: 1px 4px;
    border-radius: 4px;
    color: #fff;
}

.no-loot {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* =============================================
   REALM REWARDS SECTION
============================================= */
.realm-rewards-section {
    background: linear-gradient(135deg, rgba(212,164,23,0.15) 0%, rgba(0,0,0,0.3) 100%);
    border: 1px solid rgba(212,164,23,0.4);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 25px;
    text-align: center;
}

.realm-rewards-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.realm-icon {
    font-size: 1.8rem;
    animation: coinSpin 2s ease-in-out infinite;
}

.realm-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--gold);
    letter-spacing: 0.1em;
}

.realm-amount {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
    margin: 10px 0;
}

.realm-info {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
}

.realm-info.success { color: #4ade80; }
.realm-info.error { color: #ef4444; }

.realm-claim-btn {
    background: linear-gradient(145deg, #ffd700 0%, #b8860b 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255,215,0,0.3);
}

.realm-claim-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255,215,0,0.5);
}

.realm-claim-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(145deg, #666 0%, #444 100%);
}

.realm-claim-btn.claimed {
    background: linear-gradient(145deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

/* =============================================
   TOAST NOTIFICATIONS
============================================= */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    z-index: 9999;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: rgba(22, 101, 52, 0.95);
    border: 1px solid rgba(74, 222, 128, 0.5);
    color: #bbf7d0;
}

.toast.error {
    background: rgba(127, 29, 29, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fecaca;
}

.toast.info {
    background: rgba(30, 58, 138, 0.95);
    border: 1px solid rgba(96, 165, 250, 0.5);
    color: #bfdbfe;
}

.toast.warning {
    background: rgba(120, 89, 13, 0.95);
    border: 1px solid rgba(212, 164, 23, 0.5);
    color: #fef3c7;
}

/* =============================================
   LOADING SPINNER
============================================= */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(212,164,23,0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* =============================================
   ERROR STATE
============================================= */
.error-state {
    text-align: center;
    padding: 60px 20px;
}

.error-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* =============================================
   NAVBAR
============================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(212,164,23,0.2);
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--gold);
    letter-spacing: 0.15em;
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--gold-bright);
}

/* =============================================
   WALLET BUTTON (Navbar)
============================================= */
.wallet-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(212,164,23,0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.wallet-btn:hover {
    border-color: rgba(212,164,23,0.5);
    background: rgba(212,164,23,0.1);
}

.wallet-btn.connected {
    border-color: rgba(74,222,128,0.5);
}

.wallet-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    transition: all 0.2s;
}

.wallet-btn.connected .wallet-status-dot {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74,222,128,0.5);
}

.wallet-status-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

