/**
 * Public Styles for Wrestler Leveling System
 *
 * Frontend styles for profile widget, leaderboard, notifications, and progress bars.
 *
 * @package    Wrestler_Leveling_System
 * @subpackage Wrestler_Leveling_System/public/css
 */

/* ========================================================================
   Profile Widget
   ======================================================================== */

.wls-profile-widget {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wls-profile-widget.wls-compact {
    padding: 12px;
}

.wls-profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.wls-level-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.wls-profile-widget.wls-compact .wls-level-icon {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.wls-level-info {
    flex: 1;
}

.wls-level-name {
    display: block;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.wls-profile-widget.wls-compact .wls-level-name {
    font-size: 16px;
}

.wls-xp-amount {
    display: block;
    font-size: 14px;
    color: #646970;
}

.wls-achievement-date {
    display: block;
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin-top: 2px;
}

.wls-perk-warning {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.wls-perk-warning .dashicons {
    color: #ffc107;
    flex-shrink: 0;
    margin-top: -2px;
}

/* ========================================================================
   Progress Bar
   ======================================================================== */

.wls-progress-section {
    margin-top: 15px;
}

.wls-progress-label {
    font-size: 13px;
    color: #646970;
    margin-bottom: 6px;
}

.wls-progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.wls-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #1e5a8a 100%);
    transition: width 0.4s ease-in-out;
    border-radius: 10px;
}

.wls-progress-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: #646970;
}

.wls-progress-percentage {
    font-weight: 600;
}

.wls-max-level {
    text-align: center;
    font-size: 14px;
    color: #46b450;
    font-weight: 600;
    margin: 0;
}

/* ========================================================================
   Leaderboard
   ======================================================================== */

.wls-leaderboard {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    overflow-x: auto;
}

.wls-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.wls-leaderboard-table thead th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    color: #23282d;
    font-size: 14px;
}

.wls-leaderboard-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.wls-leaderboard-row:hover {
    background: #f9f9f9;
}

.wls-leaderboard-row.wls-current-user {
    background: #e7f5fe;
}

.wls-leaderboard-row.wls-current-user:hover {
    background: #d0ebfc;
}

.wls-rank-column {
    width: 60px;
    text-align: center;
}

.wls-rank {
    font-weight: 600;
    font-size: 16px;
    color: #2271b1;
    text-align: center;
}

.wls-wrestler {
    display: flex;
    align-items: center;
}

.wls-wrestler img.avatar {
    margin-right: 10px;
    border-radius: 50%;
}

.wls-wrestler-name {
    font-weight: 500;
}

.wls-level-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.wls-xp-column {
    text-align: right;
    width: 100px;
}

.wls-xp {
    font-weight: 600;
    color: #2271b1;
}

/* ========================================================================
   Notifications
   ======================================================================== */

.wls-notification {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    background: #fff;
    border-left: 4px solid;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 50px 16px 16px;
    margin-bottom: 10px;
    animation: wls-slide-in 0.3s ease-out;
}

@keyframes wls-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.wls-notification.wls-notification-level_achievement {
    border-left-color: #46b450;
}

.wls-notification.wls-notification-decay {
    border-left-color: #ffb900;
}

.wls-notification.wls-notification-perk_loss {
    border-left-color: #dc3232;
}

.wls-notification.wls-notification-xp_gain {
    border-left-color: #00a0d2;
}

.wls-notification.wls-notification-info {
    border-left-color: #00a0d2;
}

.wls-notification-content {
    display: flex;
    align-items: center;
}

.wls-notification-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.wls-notification-level_achievement .wls-notification-icon {
    color: #46b450;
}

.wls-notification-decay .wls-notification-icon {
    color: #ffb900;
}

.wls-notification-perk_loss .wls-notification-icon {
    color: #dc3232;
}

.wls-notification-xp_gain .wls-notification-icon {
    color: #00a0d2;
}

.wls-notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #23282d;
}

.wls-notification-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #646970;
    font-size: 18px;
}

.wls-notification-dismiss:hover {
    color: #2271b1;
}

/* Admin bar offset */
body.admin-bar .wls-notification {
    top: 46px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .wls-notification {
        top: 46px;
    }
}

/* Stack multiple notifications */
.wls-notification:nth-child(2) {
    top: calc(32px + 80px);
}

.wls-notification:nth-child(3) {
    top: calc(32px + 160px);
}

body.admin-bar .wls-notification:nth-child(2) {
    top: calc(46px + 80px);
}

body.admin-bar .wls-notification:nth-child(3) {
    top: calc(46px + 160px);
}

/* ========================================================================
   Error Messages
   ======================================================================== */

.wls-error,
.wls-info {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
}

.wls-error {
    background: #fef0f0;
    color: #dc3232;
    border-left: 4px solid #dc3232;
}

.wls-info {
    background: #e7f5fe;
    color: #2271b1;
    border-left: 4px solid #2271b1;
}

/* ========================================================================
   Responsive Adjustments
   ======================================================================== */

@media screen and (max-width: 782px) {
    .wls-notification {
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }

    .wls-leaderboard {
        padding: 12px;
    }

    .wls-leaderboard-table thead th,
    .wls-leaderboard-table tbody td {
        padding: 8px;
        font-size: 13px;
    }

    .wls-wrestler img.avatar {
        width: 24px;
        height: 24px;
    }
}

/* ========================================================================
   Utility Classes
   ======================================================================== */

.wls-hidden {
    display: none !important;
}

.wls-text-center {
    text-align: center;
}

.wls-mb-0 {
    margin-bottom: 0 !important;
}

.wls-mt-0 {
    margin-top: 0 !important;
}

/* ========================================================================
   Perks Display
   ======================================================================== */

.wls-perks-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.wls-perks-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #23282d;
}

.wls-active-perks .wls-perks-title {
    color: #46b450;
}

.wls-inactive-perks .wls-perks-title {
    color: #dc3232;
}

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

.wls-perk-item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid;
}

.wls-perk-item:last-child {
    margin-bottom: 0;
}

.wls-perk-active {
    background: #f0f9f0;
    border-color: #46b450;
}

.wls-perk-inactive {
    background: #fef5f5;
    border-color: #dc3232;
    opacity: 0.7;
}

.wls-perk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.wls-perk-name {
    font-weight: 600;
    font-size: 14px;
    color: #23282d;
}

.wls-perk-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: #f0f0f0;
    color: #646970;
}

.wls-perk-type-rp {
    background: #e7f5fe;
    color: #2271b1;
}

.wls-perk-type-combat {
    background: #fef0f0;
    color: #dc3232;
}

.wls-perk-type-social {
    background: #fcf3e5;
    color: #d68100;
}

.wls-perk-type-economic {
    background: #f0f9f0;
    color: #46b450;
}

.wls-perk-description {
    font-size: 13px;
    color: #646970;
    line-height: 1.5;
    margin: 0;
}

.wls-perk-description p {
    margin: 0;
}

.wls-perk-override-badge {
    margin-top: 8px;
    padding: 4px 8px;
    background: #e7f5fe;
    border-left: 3px solid #2271b1;
    border-radius: 3px;
    font-size: 12px;
    color: #2271b1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wls-perk-override-badge .dashicons {
    font-size: 14px;
}

.wls-inactive-perks-note {
    font-size: 13px;
    color: #dc3232;
    background: #fff;
    padding: 10px 12px;
    border-left: 3px solid #dc3232;
    border-radius: 3px;
    margin: 0 0 12px 0;
}

/* Compact mode adjustments */
.wls-profile-widget.wls-compact .wls-perks-section {
    margin-top: 15px;
    padding-top: 15px;
}

.wls-profile-widget.wls-compact .wls-perks-title {
    font-size: 14px;
}

.wls-profile-widget.wls-compact .wls-perk-item {
    padding: 8px;
    margin-bottom: 8px;
}

.wls-profile-widget.wls-compact .wls-perk-name {
    font-size: 13px;
}

.wls-profile-widget.wls-compact .wls-perk-description {
    font-size: 12px;
}
