/**
 * TELP Core Plugin - Frontend Styles
 */

/* ========================================
   Dashboard Styles
   ======================================== */
.telp-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.telp-dashboard-header {
    margin-bottom: 32px;
}

.telp-dashboard-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.telp-dashboard-header .telp-customer-id {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.telp-dashboard-header .telp-customer-id strong {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
    color: #374151;
}

/* Dashboard Tabs */
.telp-dashboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0;
}

.telp-dashboard-tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.telp-dashboard-tab:hover {
    color: #6366f1;
}

.telp-dashboard-tab.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

/* Dashboard Panels */
.telp-dashboard-panel {
    display: none;
}

.telp-dashboard-panel.active {
    display: block;
}

/* Stats Grid */
.telp-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.telp-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.telp-stat-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: #6366f1;
    line-height: 1;
}

.telp-stat-label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* User Profile Card */
.telp-profile-card {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-radius: 16px;
    padding: 32px;
    color: #fff;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.telp-profile-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.telp-profile-card .profile-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 24px;
}

.telp-profile-card .profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
}

.telp-profile-card .profile-info h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.telp-profile-card .profile-info .role-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.telp-profile-card .profile-stats {
    display: flex;
    gap: 32px;
    margin-top: 20px;
}

.telp-profile-card .profile-stat {
    text-align: center;
}

.telp-profile-card .profile-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.telp-profile-card .profile-stat-label {
    display: block;
    font-size: 12px;
    opacity: 0.8;
}

/* Content Cards */
.telp-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.telp-content-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.telp-content-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.telp-content-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.telp-content-card-body {
    padding: 24px;
}

/* Children List (Guardian Dashboard) */
.telp-children-list {
    display: grid;
    gap: 16px;
}

.telp-child-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    transition: all 0.2s;
}

.telp-child-card:hover {
    background: #f3f4f6;
}

.telp-child-card .child-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}

.telp-child-card .child-info {
    flex: 1;
}

.telp-child-card .child-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.telp-child-card .child-meta {
    font-size: 13px;
    color: #6b7280;
}

.telp-child-card .child-points {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #FEF3C7;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: #92400E;
}

/* Add Child Button */
.telp-add-child-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.telp-add-child-btn:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

/* Subscription Info */
.telp-subscription-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 24px;
    color: #fff;
}

.telp-subscription-card .plan-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.telp-subscription-card .plan-status {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 16px;
}

.telp-subscription-card .children-limit {
    font-size: 14px;
    opacity: 0.9;
}

.telp-subscription-card .children-limit strong {
    font-size: 18px;
}

/* User Management Table */
.telp-users-table {
    width: 100%;
    border-collapse: collapse;
}

.telp-users-table th,
.telp-users-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.telp-users-table th {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f9fafb;
}

.telp-users-table tr:hover td {
    background: #f9fafb;
}

.telp-users-table .user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.telp-users-table .user-cell img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.telp-users-table .customer-id {
    font-family: monospace;
    font-size: 12px;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Role Badges */
.telp-role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.telp-role-super-admin { background: #FEE2E2; color: #991B1B; }
.telp-role-product { background: #E0E7FF; color: #3730A3; }
.telp-role-csm { background: #D1FAE5; color: #065F46; }
.telp-role-esa-admin { background: #FEF3C7; color: #92400E; }
.telp-role-admin { background: #DBEAFE; color: #1E40AF; }
.telp-role-teacher { background: #FCE7F3; color: #9D174D; }
.telp-role-guardian { background: #E0F2FE; color: #075985; }
.telp-role-student { background: #F3E8FF; color: #6B21A8; }

/* Rewards Display */
.telp-rewards-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 12px;
    color: #fff;
    margin-bottom: 24px;
}

.telp-points-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
}

.telp-points-display .icon {
    font-size: 24px;
}

.telp-badges-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.telp-badge-item {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Modal Styles */
.telp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.telp-modal.active {
    display: flex;
}

.telp-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.telp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.telp-modal-close:hover {
    background: #e5e7eb;
}

.telp-modal h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* Forms */
.telp-form-group {
    margin-bottom: 20px;
}

.telp-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.telp-form-input,
.telp-form-select,
.telp-form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s;
}

.telp-form-input:focus,
.telp-form-select:focus,
.telp-form-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.telp-form-input.error {
    border-color: #ef4444;
}

/* Notifications */
.telp-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

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

.telp-notification-success {
    background: #10B981;
    color: #fff;
}

.telp-notification-error {
    background: #EF4444;
    color: #fff;
}

.telp-notification-info {
    background: #3B82F6;
    color: #fff;
}

.telp-notification-close {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .telp-dashboard {
        padding: 20px 16px;
    }
    
    .telp-profile-card .profile-content {
        flex-direction: column;
        text-align: center;
    }
    
    .telp-profile-card .profile-stats {
        justify-content: center;
    }
    
    .telp-dashboard-tabs {
        overflow-x: auto;
    }
    
    .telp-content-grid {
        grid-template-columns: 1fr;
    }
    
    .telp-modal-content {
        margin: 16px;
    }
}
