/*
 * School Challenge Platform - Public Styles
 * Version: 2.0 - Enhanced Elementor-Ready Design
 * 
 * This file is automatically loaded by the plugin
 * Just upload and styles apply automatically!
 */

/* =================================================================
   CHALLENGE CARDS GRID
   ================================================================= */

.scp-challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 40px 0;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .scp-challenges-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
}

/* =================================================================
   CHALLENGE CARD
   ================================================================= */

.scp-challenge-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.scp-challenge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* =================================================================
   CARD THUMBNAIL
   ================================================================= */

.scp-challenge-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
}

.scp-challenge-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.scp-challenge-card:hover .scp-challenge-thumbnail img {
    transform: scale(1.05);
}

/* =================================================================
   CARD CONTENT
   ================================================================= */

.scp-challenge-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* =================================================================
   CATEGORY BADGE
   ================================================================= */

.scp-challenge-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: 20px;
    background: #4f46e5;
    color: #ffffff;
    width: fit-content;
}

/* =================================================================
   CHALLENGE TITLE
   ================================================================= */

.scp-challenge-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    color: #1f2937;
}

.scp-challenge-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.scp-challenge-title a:hover {
    color: #4f46e5;
}

/* =================================================================
   CHALLENGE EXCERPT
   ================================================================= */

.scp-challenge-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
    flex: 1;
}

/* =================================================================
   CHALLENGE META (XP and Time)
   ================================================================= */

.scp-challenge-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    margin-top: auto;
}

.scp-meta-xp strong {
    color: #f59e0b;
    font-size: 16px;
}

.scp-meta-time {
    color: #6b7280;
}

/* =================================================================
   BUTTONS
   ================================================================= */

.scp-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    width: 100%;
    margin-top: 12px;
}

.scp-btn-primary {
    background: #4f46e5;
    color: #ffffff;
}

.scp-btn-primary:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.scp-btn-secondary {
    background: #6b7280;
    color: #ffffff;
}

.scp-btn-secondary:hover {
    background: #4b5563;
}

/* =================================================================
   NO RESULTS MESSAGE
   ================================================================= */

.scp-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

/* =================================================================
   SINGLE CHALLENGE PAGE
   ================================================================= */

.scp-challenge-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.scp-challenge-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.scp-category-badge,
.scp-xp-badge,
.scp-time-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.scp-category-badge {
    background: #4f46e5;
    color: #ffffff;
}

.scp-xp-badge {
    background: #f59e0b;
    color: #ffffff;
}

.scp-time-badge {
    background: #10b981;
    color: #ffffff;
}

.scp-challenge-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.scp-stat {
    text-align: center;
}

.scp-stat-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.scp-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

/* =================================================================
   STUDENT INFO BAR
   ================================================================= */

.scp-student-info {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 16px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.scp-student-info p {
    margin: 0;
    color: #1e40af;
    font-size: 14px;
}

.scp-student-info a {
    color: #3b82f6;
    text-decoration: underline;
}

/* =================================================================
   SUBMISSION FORM
   ================================================================= */

.scp-submission-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.scp-submission-form h3 {
    margin-top: 0;
    color: #1f2937;
}

.scp-form-group {
    margin-bottom: 20px;
}

.scp-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.scp-form-group textarea,
.scp-form-group input[type="text"],
.scp-form-group input[type="email"],
.scp-form-group input[type="url"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.scp-form-group textarea:focus,
.scp-form-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.scp-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* =================================================================
   FILE UPLOAD
   ================================================================= */

.scp-file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.scp-file-upload-area:hover {
    border-color: #4f46e5;
    background: #f9fafb;
}

.scp-file-upload-area.dragover {
    border-color: #4f46e5;
    background: #eff6ff;
}

/* =================================================================
   DASHBOARD
   ================================================================= */

.scp-dashboard {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.scp-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.scp-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

.scp-stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.scp-stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.scp-stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.scp-stat-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scp-stat-card .scp-stat-number {
    font-size: 36px;
    font-weight: 700;
    margin: 0;
}

/* =================================================================
   BADGE DISPLAY
   ================================================================= */

.scp-badges-earned {
    margin-top: 40px;
}

.scp-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.scp-badge-item {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.scp-badge-item:hover {
    transform: translateY(-5px);
}

.scp-badge-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.scp-badge-name {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

/* =================================================================
   LEADERBOARD
   ================================================================= */

.scp-leaderboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.scp-leaderboard-table {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scp-leaderboard-row {
    display: grid;
    grid-template-columns: 80px 1fr 80px 100px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.scp-leaderboard-row:hover {
    background: #f9fafb;
}

.scp-leaderboard-row:last-child {
    border-bottom: none;
}

.scp-leaderboard-row.scp-top-three {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.05) 0%, transparent 100%);
}

.scp-position {
    font-size: 18px;
    font-weight: 700;
    color: #4f46e5;
}

.scp-username {
    font-weight: 600;
    color: #1f2937;
}

.scp-badge {
    font-size: 24px;
    text-align: center;
}

.scp-xp {
    font-weight: 700;
    color: #f59e0b;
    text-align: right;
}

/* =================================================================
   LOGIN/REGISTER FORMS
   ================================================================= */

.scp-auth-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scp-login-prompt {
    text-align: center;
    padding: 40px;
    background: #f9fafb;
    border-radius: 12px;
    margin-top: 30px;
}

.scp-login-prompt h3 {
    margin-top: 0;
    color: #1f2937;
}

/* =================================================================
   FORM MESSAGES
   ================================================================= */

.scp-form-message {
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 14px;
}

.scp-form-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.scp-form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

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

@media (max-width: 768px) {
    .scp-challenge-meta-bar {
        flex-direction: column;
    }
    
    .scp-challenge-stats-bar {
        grid-template-columns: 1fr 1fr;
    }
    
    .scp-leaderboard-row {
        grid-template-columns: 60px 1fr 40px 80px;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .scp-dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* =================================================================
   ELEMENTOR INTEGRATION
   ================================================================= */

.elementor-widget-shortcode .scp-challenges-grid,
.elementor-widget-shortcode .scp-dashboard,
.elementor-widget-shortcode .scp-leaderboard {
    max-width: 100%;
}

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

.scp-btn:focus,
.scp-form-group input:focus,
.scp-form-group textarea:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Screen reader only text */
.scp-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;
}