/**
 * Pizza Play - Game Styles
 * Author: Tomas
 * Website: http://tobalt.lt
 * Version: 1.0.0
 * 
 * Uses Elementor default classes where possible
 */

/* === ANIMATIONS === */
@keyframes ppPlacementAnimation {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes ppPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes ppSparkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* === GAME CONTAINER === */
.pp-game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
}

.pp-game-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* === NAME ENTRY SCREEN === */
.pp-name-entry {
    padding: 40px 20px;
    text-align: center;
}

.pp-name-entry h2 {
    margin-bottom: 30px;
    color: inherit;
}

.pp-name-form {
    max-width: 400px;
    margin: 0 auto;
}

.pp-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.pp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.pp-form-group input[type="text"],
.pp-form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.pp-form-group input:focus {
    outline: none;
    border-color: #FF6B35;
}

.pp-consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0;
    text-align: left;
}

.pp-consent-checkbox input {
    margin-top: 4px;
    min-width: 18px;
    min-height: 18px;
}

.pp-consent-text {
    font-size: 14px;
    color: #666;
}

.pp-privacy-note {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

/* === GAME AREA === */
.pp-game-area {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    padding: 20px;
}

@media (max-width: 768px) {
    .pp-game-area {
        grid-template-columns: 1fr;
    }
}

/* === TOPPINGS PANEL === */
.pp-toppings-panel {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 20px;
}

.pp-toppings-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.pp-toppings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.pp-topping-item {
    text-align: center;
}

.pp-topping {
    width: 60px;
    height: 60px;
    padding: 10px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: grab;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.pp-topping:hover,
.pp-topping:focus {
    transform: scale(1.1);
    border-color: #FF6B35;
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.pp-topping:active {
    cursor: grabbing;
}

.pp-topping img,
.pp-topping svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pp-topping-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.pp-topping-counter {
    display: inline-block;
    min-width: 24px;
    height: 24px;
    line-height: 24px;
    background: #FF6B35;
    color: white;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    margin-top: 4px;
}

/* === PIZZA AREA === */
.pp-pizza-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pp-level-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.pp-level-number {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.pp-level-task {
    font-size: 24px;
    font-weight: 700;
    margin: 10px 0 0;
}

.pp-pizza-container {
    position: relative;
    background: #ffeaa7;
    border-radius: 12px;
    padding: 40px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-pizza-base {
    position: relative;
    width: 400px;
    height: 400px;
    max-width: 100%;
    background: #f6e58d;
    border-radius: 50%;
    border: 4px solid #dfe6e9;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .pp-pizza-base {
        width: 300px;
        height: 300px;
    }
}

.pp-pizza-base::after {
    content: '';
    position: absolute;
    inset: 10%;
    background: radial-gradient(circle, #fff3cd 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* === PROGRESS BAR === */
.pp-progress-section {
    margin-top: 20px;
}

.pp-progress-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.pp-progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.pp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    transition: width 0.3s ease;
    border-radius: 6px;
}

.pp-stars-display {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    font-size: 32px;
}

.pp-star {
    filter: grayscale(100%);
    opacity: 0.3;
    transition: all 0.3s;
}

.pp-star.earned {
    filter: grayscale(0%);
    opacity: 1;
    animation: ppPulse 0.5s ease;
}

/* === ACTION BUTTONS === */
.pp-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Inherit Elementor button styles */
.pp-btn {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 44px;
    min-height: 44px;
}

.pp-btn-primary {
    background: #FF6B35;
    color: white;
}

.pp-btn-primary:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,53,0.4);
}

.pp-btn-secondary {
    background: #6c757d;
    color: white;
}

.pp-btn-secondary:hover {
    background: #5a6268;
}

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

/* === FEEDBACK & NOTIFICATIONS === */
.pp-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    text-align: center;
    z-index: 9999;
    max-width: 90%;
}

.pp-feedback-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.pp-feedback-message {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.pp-sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    top: 0;
    left: 0;
}

.pp-sparkle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: gold;
    border-radius: 50%;
    animation: ppSparkle 1s ease infinite;
}

/* === AUDIO CONTROL === */
.pp-audio-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #FF6B35;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
}

.pp-audio-toggle:hover {
    background: #e55a2b;
}

/* === LOADING STATE === */
.pp-loading {
    text-align: center;
    padding: 60px 20px;
}

.pp-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FF6B35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.pp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* === FOCUS STYLES === */
*:focus-visible {
    outline: 3px solid #FF6B35;
    outline-offset: 2px;
}

/* === OFFLINE INDICATOR === */
.pp-offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #FF9800;
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* === LEADERBOARD (in-game) === */
.pp-mini-leaderboard {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.pp-mini-leaderboard h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

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

.pp-leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

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

.pp-leaderboard-rank {
    font-weight: 700;
    color: #FF6B35;
}

.pp-leaderboard-score {
    font-weight: 600;
}
