/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #05386B;
    --primary-medium: #379683;
    --primary-light: #5CDB95;
    --secondary-light: #8EE4AF;
    --background-light: #EDF5E1;
    --white: #ffffff;
    --gray-light: #f8f9fa;
    --gray-medium: #6c757d;
    --gray-dark: #343a40;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    --gradient-primary: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--primary-medium) 0%, var(--primary-light) 100%);
    --gradient-accent: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
    
    --shadow-sm: 0 2px 4px rgba(5, 56, 107, 0.1);
    --shadow-md: 0 4px 8px rgba(5, 56, 107, 0.15);
    --shadow-lg: 0 8px 16px rgba(5, 56, 107, 0.2);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-light);
    color: var(--gray-dark);
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.user-level {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.level-text {
    font-weight: 600;
    font-size: 1.1rem;
}

.xp-bar {
    width: 150px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.xp-progress {
    height: 100%;
    background: var(--gradient-accent);
    transition: width 0.3s ease;
    width: 0%;
}

.xp-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Navigation Styles */
.navigation {
    background: var(--white);
    border-bottom: 1px solid #e9ecef;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    color: var(--gray-medium);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.nav-btn:hover {
    color: var(--primary-medium);
    background: var(--gray-light);
}

.nav-btn.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-medium);
    background: var(--background-light);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

.tab-content {
    display: none;
}

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

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    margin: 0;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--gray-dark);
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-dark);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent);
    border-radius: 50%;
}

.stat-info h3 {
    color: var(--gray-medium);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-dark);
    margin: 0;
}

.progress-section {
    margin-bottom: 2rem;
}

.progress-section h2 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.goal-progress-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.goal-progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.goal-progress-fill {
    height: 100%;
    background: var(--gradient-secondary);
    transition: width 0.3s ease;
}

.recent-activity {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.recent-activity h2 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.activity-icon.success {
    background: var(--success);
    color: var(--white);
}

.activity-icon.warning {
    background: var(--warning);
    color: var(--gray-dark);
}

.activity-info {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.875rem;
    color: var(--gray-medium);
}

.no-activity {
    text-align: center;
    color: var(--gray-medium);
    padding: 2rem;
    font-style: italic;
}

/* Goals Styles */
.goals-list {
    display: grid;
    gap: 1.5rem;
}

.goal-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.goal-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.goal-header {
    background: var(--gradient-secondary);
    color: var(--white);
    padding: 1.5rem;
}

.goal-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.goal-description {
    opacity: 0.9;
    margin-bottom: 1rem;
}

.goal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.goal-body {
    padding: 1.5rem;
}

.goal-progress {
    margin-bottom: 1rem;
}

.goal-progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-medium);
}

.goal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.goal-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-status.active {
    background: var(--success);
    color: var(--white);
}

.goal-status.completed {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.goal-status.paused {
    background: var(--warning);
    color: var(--gray-dark);
}

/* Apps Styles */
.filter-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    background: var(--white);
    color: var(--gray-dark);
    font-size: 0.9rem;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.app-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.app-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.app-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.app-description {
    color: var(--gray-medium);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.app-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--gray-medium);
}

.app-body {
    padding: 1.5rem;
}

.app-progress {
    margin-bottom: 1rem;
}

.app-progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.app-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.app-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.app-progress-fill.planning {
    background: var(--info);
}

.app-progress-fill.development {
    background: var(--warning);
}

.app-progress-fill.completed {
    background: var(--success);
}

.app-progress-fill.delayed {
    background: var(--danger);
}

.app-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 1rem;
}

.app-status.planning {
    background: var(--info);
    color: var(--white);
}

.app-status.development {
    background: var(--warning);
    color: var(--gray-dark);
}

.app-status.completed {
    background: var(--success);
    color: var(--white);
}

.app-status.delayed {
    background: var(--danger);
    color: var(--white);
}

.app-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray-medium);
}

.app-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* App Details Modal */
.modal-large {
    max-width: 800px;
}

.app-details-content {
    padding: 1rem 0;
}

.app-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.app-details-info h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.app-details-info p {
    color: var(--gray-medium);
    margin-bottom: 1rem;
}

.app-checklist {
    margin: 2rem 0;
}

.app-checklist h4 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-medium);
}

.checklist-item label {
    flex: 1;
    cursor: pointer;
}

.checklist-item.completed label {
    text-decoration: line-through;
    color: var(--gray-medium);
}

/* Achievements Styles */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.achievement-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.achievement-card.unlocked {
    background: var(--gradient-accent);
    color: var(--primary-dark);
}

.achievement-card.locked {
    opacity: 0.6;
}

.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.achievement-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.achievement-description {
    font-size: 0.9rem;
    color: var(--gray-medium);
    margin-bottom: 1rem;
}

.achievement-xp {
    font-weight: 600;
    color: var(--primary-medium);
}

.achievement-card.unlocked .achievement-description,
.achievement-card.unlocked .achievement-xp {
    color: var(--primary-dark);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--white);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-medium);
    box-shadow: 0 0 0 3px rgba(55, 150, 131, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    background: var(--gray-light);
    margin: 0 -1.5rem -1.5rem;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* Notifications */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    max-width: 400px;
}

.notification {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-medium);
    animation: slideInRight 0.3s ease;
}

.notification.success {
    border-left-color: var(--success);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--gray-dark);
}

.notification-message {
    font-size: 0.9rem;
    color: var(--gray-medium);
}

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

/* Footer */
.footer {
    background: var(--primary-dark);
    color: var(--white);
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .user-level {
        justify-content: center;
    }

    .navigation {
        overflow-x: auto;
        white-space: nowrap;
    }

    .nav-btn {
        padding: 1rem 1.5rem;
        min-width: max-content;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .filter-controls {
        flex-direction: column;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .goal-meta,
    .app-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .app-dates {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .notifications-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0.5rem;
    }

    .app-title {
        font-size: 1.2rem;
    }

    .nav-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .achievement-card {
        padding: 1.5rem;
    }

    .achievement-icon {
        font-size: 2.5rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-medium);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-muted { color: var(--gray-medium); }
