/**
 * Trading Pattern Master - WordPress Plugin Styles
 * Version: 1.0.0
 */

/* Reset and container */
.tpm-wrapper {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    box-sizing: border-box;
}

.tpm-wrapper * {
    box-sizing: border-box;
}

.tpm-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    padding: 40px;
    margin: 0 auto;
}

.tpm-container h1 {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
    margin-top: 0;
}

.tpm-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* Stats */
.tpm-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.tpm-stat-item {
    text-align: center;
}

.tpm-stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.tpm-stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
}

/* Rules Section */
.tpm-rules-section {
    background: #f0f4ff;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #667eea;
    margin-bottom: 10px;
}

.tpm-rules-section h3 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 0.85em;
    text-align: center;
    margin-top: 0;
}

.tpm-rules-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-around;
    gap: 15px;
}

.tpm-rules-section li {
    color: #333;
    font-size: 0.75em;
    text-align: center;
}

/* Coupons Section */
.tpm-coupons-section {
    background: #fff9f0;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #f59e0b;
    margin-bottom: 15px;
}

.tpm-coupons-section h3 {
    color: #f59e0b;
    margin-bottom: 8px;
    font-size: 0.85em;
    text-align: center;
    margin-top: 0;
}

.tpm-coupons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tpm-coupon-item {
    background: white;
    padding: 8px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    text-align: center;
}

.tpm-coupon-item.tpm-locked {
    opacity: 0.6;
}

.tpm-coupon-item.tpm-unlocked {
    border-color: #10b981;
    background: #f0fdf4;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.tpm-coupon-lock {
    font-size: 0.7em;
    font-weight: bold;
    color: #666;
    margin-bottom: 4px;
}

.tpm-coupon-item.tpm-unlocked .tpm-coupon-lock {
    color: #10b981;
}

.tpm-coupon-content {
    font-size: 0.7em;
    color: #333;
    line-height: 1.2;
}

.tpm-coupon-code {
    font-size: 0.8em;
    font-weight: bold;
    color: #667eea;
    margin: 4px 0;
    padding: 4px 8px;
    background: #f0f4ff;
    border-radius: 4px;
    display: inline-block;
}

.tpm-coupon-code.tpm-blurred {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
}

.tpm-coupon-button {
    display: inline-block;
    margin-top: 6px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.65em;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.tpm-coupon-button:hover {
    transform: translateY(-2px);
    color: white;
}

/* Progress Bar */
.tpm-progress-container {
    margin-bottom: 20px;
}

.tpm-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
    padding: 0 2px;
}

.tpm-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.tpm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* Canvas */
.tpm-canvas-container {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    overflow: hidden;
}

#tpm-patternCanvas {
    border-radius: 5px;
    background: #2d2d2d;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Question */
.tpm-question {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* Feedback */
.tpm-feedback {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.tpm-feedback.tpm-correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.tpm-feedback.tpm-incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Options */
.tpm-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.tpm-option-btn {
    padding: 15px 20px;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: white;
    color: #333;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tpm-option-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.tpm-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.tpm-option-btn.tpm-correct {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.tpm-option-btn.tpm-incorrect {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Next Button */
.tpm-next-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
}

.tpm-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Final Score */
.tpm-final-score {
    display: none;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.tpm-final-score h2 {
    margin-bottom: 20px;
    color: white;
    margin-top: 0;
}

.tpm-score-display {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.tpm-performance {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.tpm-restart-btn {
    padding: 15px 40px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.tpm-restart-btn:hover {
    background: #764ba2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Pass/Fail styles */
.tpm-passed {
    color: #28a745;
    font-weight: bold;
}

.tpm-failed {
    color: #dc3545;
    font-weight: bold;
}

.tpm-completion-code {
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.5em;
    margin: 15px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .tpm-coupons-grid {
        grid-template-columns: 1fr;
    }
    
    .tpm-rules-section ul {
        flex-direction: column;
        gap: 5px;
    }
}

/* Comprehensive Mobile Styles */
@media (max-width: 600px) {
    .tpm-wrapper {
        padding: 10px;
    }
    
    .tpm-container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .tpm-container h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    .tpm-subtitle {
        font-size: 0.9em;
        margin-bottom: 15px;
    }
    
    .tpm-stats {
        padding: 12px;
        margin-bottom: 12px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .tpm-stat-item {
        flex: 1;
        min-width: 60px;
    }
    
    .tpm-stat-label {
        font-size: 0.75em;
    }
    
    .tpm-stat-value {
        font-size: 1.4em;
    }
    
    .tpm-rules-section {
        padding: 8px 10px;
        margin-bottom: 8px;
    }
    
    .tpm-rules-section h3 {
        font-size: 0.8em;
        margin-bottom: 5px;
    }
    
    .tpm-rules-section ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .tpm-rules-section li {
        font-size: 0.7em;
    }
    
    .tpm-coupons-section {
        padding: 8px 10px;
        margin-bottom: 10px;
    }
    
    .tpm-coupons-section h3 {
        font-size: 0.8em;
        margin-bottom: 5px;
    }
    
    .tpm-coupons-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
    
    .tpm-coupon-item {
        padding: 5px;
    }
    
    .tpm-coupon-lock {
        font-size: 0.6em;
    }
    
    .tpm-coupon-content {
        font-size: 0.55em;
    }
    
    .tpm-coupon-code {
        font-size: 0.6em;
        padding: 2px 4px;
    }
    
    .tpm-progress-container {
        margin-bottom: 12px;
    }
    
    .tpm-progress-labels {
        font-size: 0.7em;
    }
    
    .tpm-progress-bar {
        height: 6px;
    }
    
    .tpm-canvas-container {
        padding: 10px;
        margin-bottom: 15px;
        min-height: 150px;
        border-radius: 8px;
    }
    
    #tpm-patternCanvas {
        width: 100% !important;
        height: auto !important;
        max-height: 200px;
    }
    
    .tpm-question {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
    
    .tpm-feedback {
        padding: 10px;
        margin-bottom: 12px;
        font-size: 0.85em;
        border-radius: 8px;
    }
    
    .tpm-options {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .tpm-option-btn {
        padding: 12px 15px;
        font-size: 0.9em;
        border-radius: 8px;
    }
    
    .tpm-next-btn {
        padding: 12px;
        font-size: 1em;
        border-radius: 8px;
    }
    
    .tpm-final-score {
        padding: 20px;
        border-radius: 12px;
    }
    
    .tpm-final-score h2 {
        font-size: 1.3em;
    }
    
    .tpm-score-display {
        font-size: 2em;
    }
    
    .tpm-performance {
        font-size: 1em;
    }
    
    .tpm-restart-btn {
        padding: 12px 30px;
        font-size: 1em;
    }
}

@media (max-width: 380px) {
    .tpm-container {
        padding: 10px;
    }
    
    .tpm-container h1 {
        font-size: 1.3em;
    }
    
    .tpm-stats {
        padding: 10px;
    }
    
    .tpm-stat-value {
        font-size: 1.2em;
    }
    
    .tpm-coupons-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 3px;
    }
    
    .tpm-coupon-content {
        font-size: 0.5em;
    }
    
    .tpm-option-btn {
        padding: 10px;
        font-size: 0.85em;
    }
}
