* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    direction: rtl;
    color: #2d3748;
    line-height: 1.6;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 48px 40px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 420px;
    border: 1px solid #e2e8f0;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 32px;
    color: #1a202c;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: white;
    font-family: 'Vazirmatn', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5B9279;
    box-shadow: 0 0 0 3px rgba(91, 146, 121, 0.08);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Vazirmatn', sans-serif;
    white-space: nowrap;
}

.btn-primary {
    background: #5B9279;
    color: white;
    width: 100%;
    box-shadow: none;
    font-weight: 500;
}

.btn-primary:hover {
    background: #4a7a66;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: 500;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #5B9279;
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

.error-message {
    display: none;
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

/* Board Container */
.board-container {
    padding: 32px 24px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 64px);
}

.board-header {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    gap: 12px;
}

.board-header h1 {
    color: #1a202c;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
}

.board-header-icon {
    font-size: 1.25rem;
    opacity: 0.8;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Boards List */
.boards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 8px 0;
}

.boards-list-empty {
    text-align: center;
    padding: 80px 20px;
    color: #718096;
}

.boards-list-empty-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.5;
}

.boards-list-empty h3 {
    font-size: 1.5rem;
    color: #4a5568;
    margin-bottom: 12px;
    font-weight: 600;
}

.boards-list-empty p {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 32px;
}

.board-card {
    background: white;
    padding: 0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.board-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: #5B9279;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.board-card:hover::before {
    transform: scaleX(1);
}

.board-card:hover {
    border-color: #5B9279;
    box-shadow: 0 8px 24px rgba(91, 146, 121, 0.15);
    transform: translateY(-4px);
}

.board-card-image {
    width: 100%;
    height: 140px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #5B9279 0%, #4a7a66 100%);
}

.board-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.board-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 100%);
}

.board-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.board-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.board-card-icon-wrapper {
    width: 40px;
    height: 40px;
    background: rgba(91, 146, 121, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.board-card-icon {
    font-size: 1.25rem;
    filter: none;
    opacity: 0.8;
}

.board-card h3 {
    color: #1a202c;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    flex: 1;
    line-height: 1.4;
}

.board-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.board-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.board-stat-label {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 500;
}

.board-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
}

.board-stat-value.done {
    color: #5B9279;
}

.board-card-progress {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.board-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #5B9279 0%, #4a7a66 100%);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.board-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 0;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* Board View */
.board-view {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.board-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
    flex-wrap: nowrap;
}

.board-view-header h2 {
    color: #333;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.columns-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0;
    max-height: 700px;
    min-height: 700px;
    align-items: stretch;
}

.column {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px 16px 0 16px;
    min-width: 300px;
    max-width: 300px;
    width: 300px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    max-height: 700px;
    min-height: 700px;
    height: 100%;
    overflow: hidden;
    align-self: stretch;
}

.column.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.column.drag-over {
    border: 2px dashed #667eea;
    background: #e0e7ff;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    cursor: move;
    user-select: none;
}

.column-header h3 {
    color: #1a202c;
    font-size: 1rem;
    font-weight: 600;
}

.column-actions {
    display: flex;
    gap: 5px;
}

.cards-list {
    flex: 1;
    min-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    margin-right: -8px;
    display: flex;
    flex-direction: column;
}

.cards-list::-webkit-scrollbar {
    width: 6px;
}

.cards-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.cards-list::-webkit-scrollbar-thumb {
    background: #5B9279;
    border-radius: 10px;
}

.cards-list::-webkit-scrollbar-thumb:hover {
    background: #4a7a66;
}

.card {
    background: white;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: move;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    user-select: none;
    border: 1px solid #e2e8f0;
}

.card button,
.card input {
    cursor: pointer;
    pointer-events: auto;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(91, 146, 121, 0.12);
    border-color: #5B9279;
}

.card.dragging {
    opacity: 0.5;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 6px;
    gap: 8px;
}

.card-title {
    font-weight: 500;
    color: #1a202c;
    flex: 1;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.card-description {
    color: #718096;
    font-size: 0.75rem;
    margin-bottom: 6px;
    line-height: 1.4;
    max-height: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.card-due-date {
    font-size: 0.6875rem;
    color: #718096;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: #f7fafc;
    border-radius: 4px;
    display: inline-block;
    font-weight: 500;
    line-height: 1.3;
}

.card-due-date.today {
    background: #fef5e7;
    color: #c05621;
}

.card-due-date.overdue {
    background: #fed7d7;
    color: #c53030;
}

.card-due-date.done {
    background: #c6f6d5;
    color: #22543d;
    text-decoration: line-through;
}

.card-status {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.card-status input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.add-card-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px dashed #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    color: #718096;
    margin-top: 8px;
    margin-bottom: 16px;
}

.add-column-btn {
    min-width: 300px;
    max-width: 300px;
    width: 300px;
    height: fit-content;
    padding: 16px;
    background: transparent;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    cursor: pointer;
    color: #718096;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.add-column-btn:hover {
    border-color: #5B9279;
    background: rgba(91, 146, 121, 0.05);
    color: #5B9279;
}

.add-column-icon {
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1;
}

.add-column-text {
    font-size: 0.875rem;
    font-weight: 500;
}
    margin-top: 12px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.add-card-btn:hover {
    background: #f7fafc;
    border-color: #5B9279;
    color: #5B9279;
}

/* Progress Bar */
.column-progress {
    margin-top: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    border-top: 1px solid #e2e8f0;
    margin-bottom: 8px;
}

.progress-info {
    font-size: 0.75rem;
    color: #718096;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #5B9279;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 32px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Drag and Drop */
.card.drag-over {
    border: 2px dashed #667eea;
}

.column.drag-over {
    background: #e0e7ff;
}

/* Responsive */
@media (max-width: 768px) {
    .columns-container {
        flex-direction: column;
        max-height: none;
        min-height: auto;
    }
    
    .column {
        max-height: none;
    }
    
    .cards-list {
        max-height: 400px;
    }
    
    .column {
        min-width: 100%;
        max-width: 100%;
    }
    
    .board-header {
        flex-wrap: wrap;
    }
    
    .board-view-header {
        flex-wrap: wrap;
    }
    
    .header-actions {
        width: 100%;
        margin-top: 8px;
        display: flex;
        gap: 8px;
    }
    
    .header-actions .btn,
    .board-view-header .btn {
        flex: 1;
        font-size: 0.875rem;
        padding: 8px 12px;
    }
}

