@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #0079bf; /* Trello blue */
    --primary-hover: #026aa7;
    --bg-color: #f4f5f7;
    --card-bg: #ffffff;
    --sidebar-bg: #172b4d;
    --text-main: #172b4d;
    --text-muted: #5e6c84;
    --border-color: #dfe1e6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px rgba(50,50,93,0.11), 0 1px 3px rgba(0,0,0,0.08);
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* RTL Helpers */
.float-start { float: right !important; }
.float-end { float: left !important; }
.text-start { text-align: right !important; }
.text-end { text-align: left !important; }

/* Main Layout Structure */
.app-container {
    display: flex;
    flex-grow: 1;
    min-height: calc(100vh - 60px);
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    flex-shrink: 0;
    transition: all 0.3s;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    background-color: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-right: 4px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: #ffffff;
    background-color: rgba(255,255,255,0.1);
    border-right-color: var(--primary-color);
}

.sidebar-menu li a i {
    margin-left: 12px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Topbar */
.app-topbar {
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.topbar-brand {
    display: none; /* Show only on mobile if sidebar is hidden */
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

/* Main Content Area */
.app-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

/* Cards styling */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
    transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 18px 24px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* Custom Table Styling */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom-width: 1px;
    background-color: rgba(0,0,0,0.02);
    padding: 14px;
}

.table td {
    padding: 14px;
    vertical-align: middle;
}

/* Trello Kanban Board Layout */
.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 15px;
    min-height: calc(100vh - 200px);
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
}

.kanban-column {
    width: 290px;
    background-color: #ebecf0;
    border-radius: 8px;
    flex-shrink: 0;
    max-height: calc(100vh - 210px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.kanban-column-header {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.kanban-column-header .badge {
    background-color: rgba(0,0,0,0.1);
    color: var(--text-main);
    font-weight: 600;
}

.kanban-cards {
    padding: 10px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-card {
    background-color: var(--card-bg);
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 0 rgba(9,30,66,.25);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    border: 1px solid transparent;
}

.kanban-card:hover {
    box-shadow: 0 2px 4px rgba(9,30,66,.3);
    transform: translateY(-2px);
    border-color: var(--border-color);
}

.kanban-card-title {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.kanban-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(0,0,0,0.03);
    padding-top: 8px;
    margin-top: 8px;
}

/* Badges and Tags */
.badge-priority {
    font-size: 0.72rem;
    padding: 3px 6px;
    border-radius: 4px;
}

.badge-low { background-color: #e2e8f0; color: #4a5568; }
.badge-normal { background-color: #c6f6d5; color: #22543d; }
.badge-high { background-color: #feebc8; color: #744210; }
.badge-urgent { background-color: #fed7d7; color: #742a2a; }

.badge-brief {
    font-size: 0.72rem;
    padding: 2px 5px;
    border-radius: 4px;
}
.brief-incomplete { background-color: #ffd8d8; color: #c53030; }
.brief-complete { background-color: #d4edda; color: #155724; }

.badge-qa {
    font-size: 0.72rem;
    padding: 2px 5px;
    border-radius: 4px;
}
.qa-pending { background-color: #fff3cd; color: #856404; }
.qa-approved { background-color: #d4edda; color: #155724; }
.qa-needsrevision { background-color: #f8d7da; color: #721c24; }

/* Custom Styling for Detail Tabs */
.nav-tabs-custom {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    display: flex;
    gap: 5px;
}

.nav-tabs-custom .nav-link {
    border: none;
    color: var(--text-muted);
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.2s;
    border-radius: 5px 5px 0 0;
}

.nav-tabs-custom .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(0,0,0,0.02);
}

.nav-tabs-custom .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 3px solid var(--primary-color);
}

/* Custom login page styling */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
}

.login-box {
    width: 100%;
    max-width: 440px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    padding: 40px;
    border: 1px solid var(--border-color);
}

.login-logo {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 0.5px;
}

/* Button & Forms enhancements */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.form-control, .form-select {
    border-color: var(--border-color);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15);
}

/* Footer override */
.footer {
    position: static;
    margin-top: auto;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 15px 0;
    font-size: 0.88rem;
}

/* Notifications Box */
.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: rgba(0,0,0,0.01);
}

.notification-item.unread {
    background-color: rgba(0, 121, 191, 0.05);
    border-right: 4px solid var(--primary-color);
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.notification-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.notification-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Responsive styles */
@media (max-width: 991.98px) {
    .app-sidebar {
        margin-right: -260px;
        position: fixed;
        height: 100%;
    }
    
    .app-sidebar.show {
        margin-right: 0;
    }
    
    .topbar-brand {
        display: block;
        font-weight: 700;
        color: var(--primary-color);
        font-size: 1.25rem;
    }
    
    .app-content {
        padding: 15px;
    }
}

@media (max-width: 767.98px) {
    .kanban-column {
        width: 85vw;
        max-width: 320px;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border: 0;
    }
}