/*
    Theme - Professional Task Manager
    Version - 4.0
    Support - RTL, Desktop & Mobile
*/

:root {
    /* Main colors */
    --color-primary: #3867d6;
    --color-primary-dark: #2c5abc;
    --color-primary-light: #4b7ce2;
    --color-primary-soft: rgba(56, 103, 214, 0.1);
    --color-success: #28a745;
    --color-success-soft: rgba(40, 167, 69, 0.1);
    --color-success-light: rgba(40, 167, 69, 0.2);
    --color-danger: #dc3545;
    --color-danger-soft: rgba(220, 53, 69, 0.1);
    --color-danger-light: rgba(220, 53, 69, 0.2);
    --color-warning: #ffc107;
    --color-warning-soft: rgba(255, 193, 7, 0.1);
    --color-warning-light: rgba(255, 193, 7, 0.2);
    --color-info: #17a2b8;
    --color-info-soft: rgba(23, 162, 184, 0.1);
    --color-light: #f8f9fa;
    --color-dark: #343a40;
    --color-muted: #6c757d;
    --color-body-bg: #f5f7fa;
    --color-white: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.2);
    
    /* Border radiuses */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition-fast: all 0.15s ease;
    --transition-normal: all 0.25s ease-in-out;
    --transition-slow: all 0.4s ease-in-out;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Z-index layers */
    --z-index-dropdown: 1000;
    --z-index-sticky: 1020;
    --z-index-fixed: 1030;
    --z-index-modal: 1040;
    --z-index-popover: 1050;
    --z-index-tooltip: 1060;
    --z-index-toast: 1070;
}

/* ===== BASE STYLES ===== */
html, body {
    height: 100%;
}

body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--color-body-bg);
    color: var(--color-dark);
    direction: rtl;
    text-align: right;
    font-size: 0.9375rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    color: var(--color-dark);
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-normal);
}

a:hover {
    color: var(--color-primary-dark);
}

/* ===== LAYOUT ===== */
.layout-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .layout-wrapper {
        flex-direction: row;
    }
}

.main-content {
    flex: 1;
    width: 100%;
    overflow-x: hidden;
}

@media (min-width: 992px) {
    .main-content {
        margin-right: 260px;
    }
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    height: 100vh;
    background-color: var(--color-white);
    position: fixed;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    z-index: var(--z-index-fixed);
}

.sidebar-header {
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-primary);
}

.sidebar-logo .material-icons-round {
    font-size: 1.75rem;
    margin-left: var(--spacing-sm);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md) 0;
}

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin: var(--spacing-xs) 0;
}

.sidebar-nav-separator {
    height: 1px;
    background-color: rgba(0,0,0,0.05);
    margin: var(--spacing-md) var(--spacing-lg);
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--color-dark);
    font-weight: 500;
    transition: var(--transition-normal);
    border-right: 3px solid transparent;
}

.sidebar-nav-link .material-icons-round {
    margin-left: var(--spacing-md);
    color: var(--color-muted);
    transition: var(--transition-normal);
    font-size: 1.25rem;
}

.sidebar-nav-link:hover {
    background-color: var(--color-primary-soft);
    color: var(--color-primary);
}

.sidebar-nav-link:hover .material-icons-round {
    color: var(--color-primary);
}

.sidebar-nav-link.active {
    background-color: var(--color-primary-soft);
    color: var(--color-primary);
    border-right-color: var(--color-primary);
}

.sidebar-nav-link.active .material-icons-round {
    color: var(--color-primary);
}

.sidebar-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid rgba(0,0,0,0.05);
}

.sidebar-footer-link {
    display: flex;
    align-items: center;
    color: var(--color-muted);
    font-size: 0.875rem;
}

.sidebar-footer-link .material-icons-round {
    font-size: 1.125rem;
    margin-left: var(--spacing-sm);
}

/* ===== DESKTOP HEADER ===== */
.desktop-header {
    background-color: var(--color-white);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: var(--spacing-sm) 0;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 0;
}

.search-box {
    width: 320px;
}

.search-box .input-group {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.search-box .form-control {
    border-color: var(--color-light);
    height: 42px;
}

.search-box .input-group-text {
    color: var(--color-muted);
    border-color: var(--color-light);
}

/* ===== SUMMARY CARDS ===== */
.summary-card {
    border: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    height: 100%;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.summary-card .card-body {
    padding: var(--spacing-lg);
}

.summary-card .card-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-dark);
}

.summary-card .card-subtitle {
    font-size: 0.875rem;
    color: var(--color-muted);
}

.summary-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-icon {
    font-size: 1.75rem;
    color: var(--color-primary);
}

/* ===== UTILITY CLASSES ===== */
.bg-primary-soft {
    background-color: var(--color-primary-soft);
}

.bg-primary-light {
    background-color: var(--color-primary-light);
}

.bg-success-soft {
    background-color: var(--color-success-soft);
}

.bg-success-light {
    background-color: var(--color-success-light);
}

.bg-danger-soft {
    background-color: var(--color-danger-soft);
}

.bg-danger-light {
    background-color: var(--color-danger-light);
}

.bg-warning-soft {
    background-color: var(--color-warning-soft);
}

.bg-warning-light {
    background-color: var(--color-warning-light);
}

.bg-info-soft {
    background-color: var(--color-info-soft);
}

/* ===== TASK CARDS STYLES ===== */
/* Task Card Grid Layout */
.tasks-grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 768px) {
    .tasks-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* Task Card Mobile Improvements */
.task-card {
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.task-header-main {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    word-break: break-word;
}

.task-badge {
    display: flex;
    align-items: center;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 12px;
    color: white;
}

.task-badge.bg-warning {
    color: #212529;
}

.priority-icon {
    font-size: 14px;
    margin-left: 4px;
}

.task-deadline-mobile {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 8px;
}

.task-deadline-mobile .material-icons-round {
    font-size: 16px;
    color: #6c757d;
}

/* Expandable task description */
.task-description {
    position: relative;
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 0;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    word-break: break-word;
}

.task-description.expanded {
    max-height: 500px;
}

.read-more-btn {
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-size: 12px;
    padding: 4px 0;
    cursor: pointer;
    font-weight: 500;
    margin-top: 4px;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
}

.read-more-btn .material-icons-round {
    font-size: 16px;
    margin-right: 4px;
}

.description-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}

/* Improved Action Buttons */
.task-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.task-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-button .material-icons-round {
    font-size: 18px;
    margin-left: 6px;
}

.btn-complete {
    background-color: #28a745;
    color: white;
}

.btn-complete:hover {
    background-color: #218838;
    color: white;
}

.btn-edit {
    background-color: #3867d6;
    color: white;
}

.btn-edit:hover {
    background-color: #2d53a8;
    color: white;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-delete:hover {
    background-color: #c82333;
    color: white;
}

/* For larger screens */
@media (min-width: 576px) {
    .task-title {
        font-size: 18px;
    }
    
    .task-button {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .task-button .material-icons-round {
        font-size: 20px;
    }
}

/* Desktop Task Table Styles */
.task-table th, 
.task-table td {
    vertical-align: middle;
}

.task-name-cell {
    font-weight: 500;
}

.deadline-info {
    font-size: 14px;
    line-height: 1.3;
}

.desktop-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.desktop-task-card {
    display: flex;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.desktop-task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.desktop-task-priority {
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desktop-task-content {
    flex: 1;
    padding: 16px;
    position: relative;
}

.desktop-task-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desktop-task-description {
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.desktop-task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.desktop-task-deadline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.desktop-task-deadline .material-icons-round {
    font-size: 16px;
    color: #6c757d;
}

.desktop-task-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.desktop-task-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.desktop-task-complete-btn {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.desktop-task-complete-btn:hover {
    background-color: #c8e6c9;
}

.desktop-task-edit-btn {
    background-color: #e3f2fd;
    color: #1976d2;
}

.desktop-task-edit-btn:hover {
    background-color: #bbdefb;
}

.desktop-task-delete-btn {
    background-color: #ffebee;
    color: #d32f2f;
}

.desktop-task-delete-btn:hover {
    background-color: #ffcdd2;
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 64px;
    color: var(--color-muted);
    opacity: 0.5;
    display: block;
    margin-bottom: 16px;
}

/* Floating action button */
.fab-button {
    width: 56px;
    height: 56px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.fab-button .material-icons-round {
    font-size: 24px;
}

/* Mobile nav styles */
.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--color-dark);
}

.mobile-nav-link.active {
    background-color: var(--color-primary-soft);
    color: var(--color-primary);
}

.mobile-nav-link .nav-icon {
    margin-left: 12px;
    color: var(--color-muted);
}

.mobile-nav-link.active .nav-icon {
    color: var(--color-primary);
}

.mobile-action-btn {
    width: 36px;
    height: 36px;
}

/* Desktop Card Task Description */
.desktop-task-description {
    position: relative;
    max-height: 40px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-muted);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 8px 0;
}

.desktop-task-description.expanded {
    max-height: 500px;
}

.desktop-task-description .description-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}
.desktop-task-description-preview {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 10px;
    padding: 5px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.desktop-task-description-container {
    margin: 8px 0;
    font-size: 13px;
}

.desktop-task-description-preview,
.desktop-task-description-full {
    padding: 8px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.read-more-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 13px;
    padding: 4px 0;
    margin-top: 4px;
    cursor: pointer;
}

.read-more-btn:hover {
    color: var(--color-primary-dark);
}