/* ==================================================
   Gutenberg Blocks - Frontend Styles
   LuckyMCP Gaming Theme
   ================================================== */

/* Base Styling */
.luckymcp-block-error {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 15px;
    color: #c33;
    margin: 20px 0;
    font-weight: 500;
}

.luckymcp-block-error p {
    margin: 0;
}

/* ==================================================
   SERVER STATUS BLOCK
   ================================================== */

.luckymcp-server-status {
    margin: 20px 0;
}

/* Card Layout - Default */
.luckymcp-server-status.card {
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
    border: 1px solid #3d4158;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.luckymcp-server-status.card h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #fff;
    font-weight: 700;
}

.luckymcp-server-status.card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.luckymcp-server-status.card .card-header h3 {
    margin: 0;
    flex: 1;
}

.luckymcp-server-status.card .card-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Players Section */
.players-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.players-label {
    font-weight: 600;
    min-width: 100px;
    color: #a0a0c0;
}

.players-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    min-width: 100px;
}

.players-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
}

.players-count {
    font-weight: 600;
    min-width: 80px;
    text-align: right;
    color: #20c997;
}

/* Ping Section */
.ping-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.ping-label {
    font-weight: 600;
    min-width: 100px;
    color: #a0a0c0;
}

.ping-value {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 14px;
}

.ping-value.good {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.ping-value.ok {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.ping-value.bad {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Status Badge */
.status-badge {
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
}

.status-badge.online {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.status-badge.offline {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Minimal Layout */
.luckymcp-server-status.minimal {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #f9f9f9 0%, #f5f5f5 100%);
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.luckymcp-server-status.minimal .server-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

/* Detailed Layout */
.luckymcp-server-status.detailed {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.luckymcp-server-status.detailed .status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.luckymcp-server-status.detailed .status-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 700;
}

.luckymcp-server-status.detailed .status-info {
    display: grid;
    gap: 10px;
}

.luckymcp-server-status.detailed .info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.luckymcp-server-status.detailed .info-item .label {
    font-weight: 600;
    color: #666;
}

.luckymcp-server-status.detailed .info-item .value {
    color: #0073aa;
    font-weight: 600;
}

/* ==================================================
   RANKING BLOCK
   ================================================== */

.luckymcp-block-ranking {
    margin: 20px 0;
}

.luckymcp-block-ranking.empty {
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 4px;
    padding: 40px;
    text-align: center;
}

/* Table Layout - Default */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ranking-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ranking-table thead th {
    padding: 14px;
    text-align: left;
    font-weight: 700;
    color: #fff;
    border: none;
}

.ranking-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e5e5;
}

.ranking-table tbody tr {
    transition: background-color 0.2s ease;
}

.ranking-table tbody tr:hover {
    background: #f5f7ff;
}

.ranking-table tbody tr:last-child td {
    border-bottom: none;
}

.ranking-table .rank {
    text-align: center;
    font-weight: 700;
    color: #667eea;
    width: 50px;
}

.ranking-table .name {
    font-weight: 600;
    color: #333;
}

.ranking-table .class {
    color: #666;
    font-size: 14px;
}

.ranking-table .level {
    text-align: right;
    font-weight: 700;
    color: #667eea;
    width: 60px;
}

.ranking-table .members {
    text-align: center;
    font-weight: 600;
    color: #764ba2;
}

.ranking-table .exp {
    text-align: right;
    color: #666;
    font-size: 14px;
}

/* List Layout */
.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid #e5e5e5;
    transition: background-color 0.2s ease;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: #f5f7ff;
}

.ranking-item .rank-number {
    font-weight: 700;
    font-size: 16px;
    color: #667eea;
    min-width: 40px;
}

.ranking-item .rank-name {
    font-weight: 600;
    color: #333;
    flex: 1;
    margin: 0 15px;
}

.ranking-item .rank-class,
.ranking-item .rank-level {
    color: #666;
    font-size: 14px;
    margin: 0 8px;
}

.ranking-item .rank-level {
    font-weight: 600;
    color: #667eea;
}

.ranking-item .rank-members {
    color: #764ba2;
    font-weight: 600;
    min-width: 120px;
    text-align: right;
}

/* Cards Layout */
.luckymcp-block-ranking.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.ranking-card {
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
}

.ranking-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.ranking-card .card-rank {
    font-weight: 700;
    font-size: 20px;
    color: #667eea;
    margin-bottom: 8px;
}

.ranking-card .card-name {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-card .card-class,
.ranking-card .card-level,
.ranking-card .card-members {
    font-size: 13px;
    color: #666;
    margin: 4px 0;
}

.ranking-card .card-level strong {
    color: #667eea;
    font-weight: 700;
}

/* Top 3 Special Styling */
.ranking-card:nth-child(1) {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-color: #ffc700;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.ranking-card:nth-child(1) .card-rank,
.ranking-card:nth-child(1) .card-name {
    color: #b8860b;
}

.ranking-card:nth-child(2) {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    border-color: #a8a8a8;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.3);
}

.ranking-card:nth-child(2) .card-rank,
.ranking-card:nth-child(2) .card-name {
    color: #696969;
}

.ranking-card:nth-child(3) {
    background: linear-gradient(135deg, #cd7f32 0%, #e8b4a8 100%);
    border-color: #b87333;
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.3);
}

.ranking-card:nth-child(3) .card-rank,
.ranking-card:nth-child(3) .card-name {
    color: #8b4513;
}

/* ==================================================
   VOTE4COINS BLOCK
   ================================================== */

.luckymcp-block-vote4coins {
    margin: 20px 0;
}

/* Button Layout */
.luckymcp-block-vote4coins.button {
    text-align: center;
}

.luckymcp-block-vote4coins.button .vote-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 14px;
}

.luckymcp-block-vote4coins.button .vote-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.vote-icon {
    font-size: 18px;
}

.vote-reward {
    display: inline-block;
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Card Layout - Default */
.luckymcp-block-vote4coins.card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.luckymcp-block-vote4coins.card .card-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.luckymcp-block-vote4coins.card .card-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.luckymcp-block-vote4coins.card h3 {
    margin: 0;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.luckymcp-block-vote4coins.card .card-body {
    padding: 25px 20px;
    color: #fff;
}

.reward-section {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.reward-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.coins-icon {
    font-size: 24px;
}

.coins-number {
    font-size: 32px;
    font-weight: 700;
}

.coins-label {
    font-size: 14px;
    opacity: 0.9;
}

.reward-text {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.cooldown-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.cooldown-icon {
    font-size: 16px;
}

.cooldown-text {
    font-size: 14px;
    font-weight: 600;
}

.stats-section {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    text-align: center;
}

.stats-section p {
    margin: 5px 0;
    font-size: 14px;
}

.luckymcp-block-vote4coins.card .card-footer {
    padding: 0 20px 20px;
    text-align: center;
}

.luckymcp-block-vote4coins.card .vote-button {
    display: inline-block;
    background: #fff;
    color: #667eea;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    width: 100%;
    font-size: 16px;
}

.luckymcp-block-vote4coins.card .vote-button:hover {
    background: #f5f5f5;
    transform: scale(1.02);
}

/* Detailed Layout */
.luckymcp-block-vote4coins.detailed {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.luckymcp-block-vote4coins.detailed .vote-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.luckymcp-block-vote4coins.detailed .vote-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 10px;
}

.luckymcp-block-vote4coins.detailed h3 {
    margin: 0;
    color: #333;
    font-weight: 700;
    font-size: 18px;
}

.luckymcp-block-vote4coins.detailed .vote-info {
    background: #f9f9f9;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
}

.luckymcp-block-vote4coins.detailed .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
}

.luckymcp-block-vote4coins.detailed .info-row:last-child {
    border-bottom: none;
}

.luckymcp-block-vote4coins.detailed .label {
    color: #666;
    font-weight: 600;
}

.luckymcp-block-vote4coins.detailed .value {
    color: #667eea;
    font-weight: 600;
}

.luckymcp-block-vote4coins.detailed .vote-action {
    text-align: center;
    margin-top: 20px;
}

.luckymcp-block-vote4coins.detailed .vote-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    padding: 14px 30px;
    display: inline-block;
    width: auto;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.luckymcp-block-vote4coins.detailed .vote-button-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.vote-message {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.vote-message.voted {
    color: #28a745;
    font-weight: 600;
}

/* ==================================================
   RESPONSIVE DESIGN
   ================================================== */

@media (max-width: 768px) {
    /* Server Status */
    .luckymcp-server-status.card .card-body {
        gap: 12px;
    }

    .players-line,
    .ping-line {
        flex-direction: column;
        align-items: flex-start;
    }

    .players-bar {
        width: 100%;
    }

    /* Ranking */
    .luckymcp-block-ranking.cards {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .ranking-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .ranking-item .rank-name {
        flex-basis: 100%;
    }

    /* Vote4Coins */
    .luckymcp-block-vote4coins.card .card-body {
        padding: 20px 15px;
    }

    .reward-section {
        padding: 15px;
    }

    .coins-number {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    /* Server Status */
    .luckymcp-server-status.card {
        padding: 15px;
    }

    .luckymcp-server-status.card h3 {
        font-size: 16px;
    }

    /* Ranking */
    .luckymcp-block-ranking.cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .ranking-table {
        font-size: 12px;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 8px;
    }

    /* Vote4Coins */
    .luckymcp-block-vote4coins.card .card-body {
        padding: 15px;
    }

    .reward-section {
        padding: 12px;
    }

    .coins-number {
        font-size: 24px;
    }

    .luckymcp-block-vote4coins.card .vote-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .luckymcp-block-vote4coins.detailed {
        padding: 20px;
    }
}

/* ==================================================
   ACCESSIBILITY
   ================================================== */

.vote-button:focus,
.ranking-card:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .luckymcp-server-status.card,
    .luckymcp-block-ranking,
    .luckymcp-block-vote4coins {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
