/**
 * Fundamanje Elementor Widgets - Common Styles
 *
 * @package Fundamanje
 */

/* Base widget styles */
.fundamanje-widget {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.fundamanje-widget * {
    box-sizing: border-box;
}

/* Study Plan Widget Styles */
.study-plan-widget .study-plan-title {
    color: #2575fc;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.study-plan-widget #study_plan {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    color: #2575fc;
    margin-bottom: 20px;
}

.study-plan-widget .sidebar-posts {
    max-height: 400px;
    overflow-y: auto;
}

.study-plan-widget .study_plans {
    padding: 10px 0;
}

.study-plan-widget details {
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
}

.study-plan-widget summary {
    font-weight: 600;
    cursor: pointer;
    padding: 10px 0;
    color: #2575fc;
}

.study-plan-widget .sidebar-posts a {
    color: #2575fc;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.3s ease;
}

.study-plan-widget .sidebar-posts a:hover {
    color: #1a5bb8;
    padding-left: 10px;
}

/* Subject Stats Widget Styles */
.subject-stats-widget .stats-title {
    color: #2575fc;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.subject-stats-widget .stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.subject-stats-widget .stats-table th,
.subject-stats-widget .stats-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.subject-stats-widget .stats-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2575fc;
}

.subject-stats-widget .stats-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.subject-stats-widget .stats-table canvas {
    max-width: 200px;
    max-height: 150px;
}

/* NBT Practice Tool Elementor Integration */
.nbt-practice-tool-elementor .nbt-practice-tool-container {
    background: transparent;
    box-shadow: none;
    margin: 0;
}

/* Responsive adjustments for Elementor */
@media (max-width: 768px) {
    .fundamanje-widget {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .subject-stats-widget .stats-table {
        font-size: 14px;
    }
    
    .subject-stats-widget .stats-table th,
    .subject-stats-widget .stats-table td {
        padding: 8px;
    }
    
    .study-plan-widget #study_plan {
        font-size: 14px;
    }
}

/* Loading states */
.fundamanje-widget .loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #666;
}

.fundamanje-widget .loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2575fc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Error states */
.fundamanje-widget .error {
    background-color: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #c33;
    margin: 10px 0;
}

/* Success states */
.fundamanje-widget .success {
    background-color: #efe;
    color: #3c3;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #3c3;
    margin: 10px 0;
}

/* My Subscription Widget Styles */
.my-subscription-widget .subscription-title {
    color: #2575fc;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.my-subscription-widget .subscription-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.my-subscription-widget .subscription-table th,
.my-subscription-widget .subscription-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.my-subscription-widget .subscription-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2575fc;
}

.my-subscription-widget .subscription-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.my-subscription-widget .subscribe-button {
    display: inline-block;
    background-color: #2575fc;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.my-subscription-widget .subscribe-button:hover {
    background-color: #1a5bb8;
    color: white;
}

.my-subscription-widget .status-active {
    color: #28a745;
    font-weight: 600;
}

.my-subscription-widget .status-cancelled {
    color: #dc3545;
    font-weight: 600;
}

.my-subscription-widget .status-pending {
    color: #ffc107;
    font-weight: 600;
}

/* Navigate Widget Styles */
.navigate-widget .navigate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    gap: 10px;
}

.navigate-widget .navigate a {
    padding: 10px 20px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.navigate-widget .navigate a:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.navigate-widget .navigate .category {
    flex: 1;
    text-align: center;
}

.navigate-widget .navigate .category a {
    background-color: green;
    display: block;
    padding: 10px 20px;
}

.navigate-widget .navigate a.nav-button {
    background-color: royalblue;
}

@media (max-width: 768px) {
    .navigate-widget .navigate {
        flex-direction: column;
        gap: 5px;
    }
    
    .navigate-widget .navigate a {
        width: 100%;
        text-align: center;
    }
    
    .navigate-widget .navigate .category {
        order: -1;
    }
}

/* Quiz Link Widget Styles */
.quiz-link-widget .quiz-link-container {
    margin: 15px 0;
}

.quiz-link-widget .quiz-link-center {
    display: flex;
    justify-content: center;
}

.quiz-link-widget .quiz-link-button {
    background-color: #2575fc;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quiz-link-widget .quiz-link-button:hover {
    background-color: #1a5bb8;
    transform: translateY(-1px);
}

.quiz-link-widget .quiz-link-button:active {
    transform: translateY(0);
}

/* Offer Widget Styles */
.offer-widget .offer-debug-info {
    background: #f9f9f9;
    padding: 10px;
    margin: 10px 0;
    border-left: 4px solid #00a0d2;
    border-radius: 4px;
}

.offer-widget .offer-debug-info h4 {
    margin: 0 0 10px 0;
    color: #00a0d2;
    font-size: 14px;
}

.offer-widget .offer-debug-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.offer-widget .offer-debug-info li {
    margin: 5px 0;
    font-size: 13px;
}

/* Advocate Key Widget Styles */
.advocate-key-widget .advocate-title {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.advocate-key-widget .advocate-coupon {
    background-color: #4CAF50;
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
    font-family: monospace;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.advocate-key-widget .advocate-message {
    margin: 15px 0;
    line-height: 1.6;
}

.advocate-key-widget .advocate-message a {
    color: #2575fc;
    text-decoration: none;
    font-weight: 600;
}

.advocate-key-widget .advocate-message a:hover {
    color: #1a5bb8;
    text-decoration: underline;
}

/* Lesson Widget Styles */
.lesson-widget .lesson-tabs {
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.lesson-widget .lesson-tabs ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.lesson-widget .lesson-tabs li {
    margin: 0;
}

.lesson-widget .lesson-tabs a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #666;
    border-radius: 6px 6px 0 0;
    transition: all 0.3s ease;
    font-weight: 600;
}

.lesson-widget .lesson-tabs a:hover {
    background-color: #f8f9fa;
    color: #2575fc;
}

.lesson-widget .lesson-tabs a.active {
    background-color: #2575fc;
    color: white;
    border-bottom: 2px solid #2575fc;
}

.lesson-widget .tab-content {
    display: none;
    padding: 20px 0;
}

.lesson-widget .tab-content.active {
    display: block;
}

.lesson-widget .lesson-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lesson-widget .lesson-list li {
    margin-bottom: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #2575fc;
}

.lesson-widget .lesson-list a {
    color: #2575fc;
    text-decoration: none;
    font-weight: 500;
    display: block;
}

.lesson-widget .lesson-list a:hover {
    color: #1a5bb8;
}

.lesson-widget .lesson-meta {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .lesson-widget .lesson-tabs ul {
        flex-direction: column;
        gap: 2px;
    }
    
    .lesson-widget .lesson-tabs a {
        border-radius: 6px;
        text-align: center;
    }
}