/* TPD Dashboard System - Extends TPD for Dashboard Layouts */

/* ===== DASHBOARD LAYOUT STRUCTURE ===== */

/* Main Dashboard Container */
.tpd-dashboard {
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    width: 100%;
    background: #f8f9fa;
}

/* Override base template container for dashboard */
.tpd-dashboard .container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

/* ===== SIDEBAR SYSTEM ===== */

.tpd-sidebar {
    height: 100vh;
    width: 220px;
    min-width: 200px;
    position: sticky;
    top: 0;
    background: #2c3e50;
    border-right: 4px solid #3498db;
    color: white;

    padding: 0;
    margin: 0;
    border: none;
    flex-shrink: 0;
    z-index: 50;
    overflow-y: auto;
}

.tpd-sidebar-inner {
    padding-top: var(--sidebar-padding, 0);
    transition: padding-top 0.3s cubic-bezier(0.4,0,0.2,1);
    box-sizing: border-box;
}

.tpd-sidebar-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 12px 18px 12px;
}

.tpd-sidebar-header h2 {
    font-size: 1.3rem;
    color: white;
    margin-bottom: 0.5rem;
}

.tpd-sidebar-header p {
    color: rgba(255,255,255,0.8);
    margin: 0;
}

.tpd-sidebar-nav {
    padding: 0 12px;
}

.tpd-nav-link {
    color: white !important;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
}

.tpd-nav-link:hover,
.tpd-nav-link.active {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db !important;
}

.tpd-nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* ===== TPD BUTTONS ===== */

.tpd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f3f4f6;
    color: #374151;
    line-height: 1.5;
}

.tpd-btn:hover {
    transform: translateY(-1px);

    text-decoration: none;
}

.tpd-btn:active {
    transform: translateY(0);
}

.tpd-btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.tpd-btn-primary {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.tpd-btn-primary:hover {
    background: #2980b9;
    color: white;
}

.tpd-btn-secondary {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

.tpd-btn-secondary:hover {
    background: #4b5563;
    color: white;
}

.tpd-btn-success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.tpd-btn-success:hover {
    background: #059669;
    color: white;
}

.tpd-btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.tpd-btn-danger:hover {
    background: #dc2626;
    color: white;
}

.tpd-btn-warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.tpd-btn-warning:hover {
    background: #d97706;
    color: white;
}

.tpd-btn-info {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.tpd-btn-info:hover {
    background: #2563eb;
    color: white;
}

.tpd-btn-outline {
    background: transparent;
    border-color: #d1d5db;
    color: #374151;
}

.tpd-btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.tpd-btn-outline-primary {
    background: transparent;
    border-color: #3498db;
    color: #3498db;
}

.tpd-btn-outline-primary:hover {
    background: #3498db;
    color: white;
}

.tpd-btn-outline-secondary {
    background: transparent;
    border-color: #6b7280;
    color: #6b7280;
}

.tpd-btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
}

.tpd-btn-outline-danger {
    background: transparent;
    border-color: #ef4444;
    color: #ef4444;
}

.tpd-btn-outline-danger:hover {
    background: #ef4444;
    color: white;
}

/* ===== TPD BADGES ===== */

.tpd-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    color: white;
}

.tpd-badge-warning {
    background: #f59e0b;
}

.tpd-badge-success {
    background: #10b981;
}

.tpd-badge-danger {
    background: #ef4444;
}

.tpd-badge-info {
    background: #3b82f6;
}

/* ===== TPD TEXT UTILITIES ===== */

.tpd-text-muted {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.tpd-header {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ===== MAIN CONTENT AREA ===== */

.tpd-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #f8f9fa;
}

.tpd-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    margin-bottom: 24px;

}

.tpd-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.tpd-section-header i {
    font-size: 1.5rem;
    color: #3498db;
}

.tpd-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
	padding-bottom: 14px;
}

/* ===== STATISTICS CARDS ===== */

.tpd-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.tpd-stat-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 16px;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tpd-stat-card:hover {
    transform: translateY(-2px);

}

.tpd-stat-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.tpd-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
    color: white;
    background: #3498db;
}

.tpd-stat-icon.success { background: #10b981; }
.tpd-stat-icon.warning { background: #f59e0b; }
.tpd-stat-icon.danger { background: #ef4444; }
.tpd-stat-icon.info { background: #3b82f6; }

.tpd-stat-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 2px 0;
}

.tpd-stat-content p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.tpd-stat-value {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-top: 6px;
}

.tpd-stat-value.success { color: #10b981; }
.tpd-stat-value.warning { color: #f59e0b; }
.tpd-stat-value.danger { color: #ef4444; }

/* ===== STUDENT CARDS ===== */

.tpd-student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    justify-content: start;
    align-items: stretch;
}

.tpd-student-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 1rem;

    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.tpd-student-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tpd-student-icon {
    font-size: 2rem;
    margin-right: 0.75rem;
}

.tpd-student-info h3 {
    margin: 0 0 2px 0;
    font-size: 1rem;
    color: #1f2937;
}

.tpd-student-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.85rem; /* Slightly smaller */
    overflow-wrap: break-word; /* Allow breaking */
    word-break: break-all; /* Break long emails */
    white-space: normal; /* Allow wrapping */
    max-width: 100%;
    line-height: 1.3;
}

.tpd-student-details {
    margin-bottom: 0.5rem;
}

.tpd-detail-row {
    margin-bottom: 2px;
}

.tpd-detail-label {
    font-weight: 600;
    color: #374151;
}

.tpd-detail-value {
    color: #10b981;
}

.tpd-student-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

/* ===== CALENDAR COMPONENTS ===== */
/* Calendar styles removed - use calendar.css instead */

/* ===== TASK AND EVENT LISTS ===== */

.tpd-tasks-homework-row {
    display: flex;
    gap: 20px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.tpd-upcoming-events {
    flex: 1 1 0;
    min-width: 220px;
    background: #f9fafb;
    border-radius: 10px;
    padding: 18px 16px;
    margin-bottom: 0;
}

.tpd-events-title {
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1f2937;
}

.tpd-event-item {
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.tpd-event-item:last-child {
    border-bottom: none;
}

.tpd-event-date {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.tpd-event-title {
    font-size: 0.9rem;
    color: #1f2937;
    font-weight: 500;
}

.tpd-event-title.empty-state {
    color: #6b7280;
    font-style: italic;
}

/* ===== JAVASCRIPT STATE CLASSES ===== */

/* Section visibility */
.tpd-section.hidden {
    display: none;
}

.tpd-section.visible {
    display: block;
}

/* Task interaction states */
.tpd-task-item.clicked {
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.tpd-task-item {
    transition: opacity 0.15s ease;
}

/* Loading state for events */
.tpd-upcoming-events.loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tpd-tasks-section {
    flex: 1 1 0;
    min-width: 220px;
    background: #f9fafb;
    border-radius: 10px;
    padding: 18px 16px;
    margin-bottom: 0;
}

.tpd-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tpd-task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.tpd-task-item:last-child {
    border-bottom: none;
}

.tpd-task-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.tpd-task-content {
    flex: 1;
}

.tpd-task-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.tpd-task-description {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
}

/* ===== SEARCH COMPONENTS ===== */

.tpd-search-section {
    margin-bottom: 12px;
}

.tpd-search-container {
    position: relative;
}

.tpd-search-input {
    width: 100%;
    padding: 12px 16px;
    padding-left: 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tpd-search-input:focus {
    outline: none;
    border-color: #3498db;

}

.tpd-search-input::placeholder {
    color: #9ca3af;
}

.tpd-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
}

/* ===== PROGRAM CARDS ===== */

.tpd-program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.tpd-program-card {
    position: relative;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 20px;
    padding-bottom: 70px; /* Increased room for buttons */

    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 220px;
    overflow: visible;
}

.tpd-program-card:hover {
    transform: translateY(-2px);

}

.tpd-program-content {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tpd-program-content:hover {
    text-decoration: none;
    color: inherit;
}

.tpd-program-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.tpd-program-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.tpd-program-image-placeholder {
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    color: #9ca3af;
    flex-shrink: 0;
}

.tpd-program-info {
    flex: 1;
    min-width: 0;
}

.tpd-program-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.3;
}

.tpd-program-cefr {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.tpd-program-objectives {
    margin-bottom: 16px;
}

.tpd-program-objectives h6 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 8px;
}

.tpd-program-objectives p {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
    margin: 0;
}

.tpd-program-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tpd-program-courses {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tpd-program-actions {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
    z-index: 10;
    background: white;
    padding: 6px;
    border-radius: 6px;

}

.tpd-program-actions .tpd-btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
    min-height: 28px;
    min-width: 50px;
    border: 1px solid #d1d5db;

    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tpd-program-empty {
    text-align: center;
    padding: 48px 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.tpd-program-empty i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 16px;
}

.tpd-program-empty h4 {
    font-size: 1.25rem;
    color: #374151;
    margin-bottom: 8px;
}

.tpd-program-empty p {
    color: #6b7280;
    margin-bottom: 24px;
}

/* ===== PAYMENT COMPONENTS ===== */

.tpd-payment-list {
    margin-top: 16px;
}

.tpd-payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}

.tpd-payment-item:last-child {
    border-bottom: none;
}

.tpd-payment-info {
    flex: 1;
}

.tpd-payment-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.tpd-payment-date {
    font-size: 12px;
    color: #6b7280;
}

.tpd-payment-amount {
    font-size: 16px;
    font-weight: 600;
    color: #ef4444;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .tpd-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 4px solid #3498db;
    }
    
    .tpd-main {
        padding: 16px;
    }
    
    .tpd-dashboard {
        flex-direction: column;
    }
    
    .tpd-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tpd-student-grid {
        justify-content: center;
    }
    
    .tpd-tasks-homework-row {
        flex-direction: column;
    }
    
    /* Calendar styles removed - use calendar.css instead */
}

@media (max-width: 900px) {
    .tpd-stats-grid {
        margin-bottom: 16px;
    }
} 