/* Base styles and resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4680ff;
    --primary-hover: #2d6eed;
    --danger-color: #ff5f5f;
    --text-color: #333;
    --light-text: #767676;
    --border-color: #e3e3e3;
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.85);
    --list-bg: rgba(240, 242, 245, 0.85);
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    --modal-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Button styles */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--primary-hover);
}

.btn.secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn.secondary:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn.danger {
    background-color: var(--danger-color);
    color: white;
}

.btn.danger:hover {
    background-color: #e55555;
}

.btn.icon {
    padding: 6px;
    border-radius: 50%;
    background: transparent;
}

.btn.icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: white;
    box-shadow: var(--shadow);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
}

.logo i {
    font-size: 24px;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
}

main {
    flex: 1;
    padding: 24px;
    overflow-x: auto;
}

/* Lists container */
.lists-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    min-height: calc(100vh - 150px);
}

/* List styles */
.list {
    background-color: var(--list-bg);
    border-radius: 8px;
    width: 280px;
    min-width: 280px;
    max-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.list-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.list-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    word-break: break-word;
    max-width: 200px;
}

.cards-container {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 50px;
}

/* Card styles */
.card {
    background-color: var(--card-bg);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: var(--card-shadow);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.card-title {
    word-break: break-word;
    font-size: 14px;
    color: var(--text-color);
}

/* Sortable drag styles */
.sortable-ghost {
    opacity: 0.5;
    background-color: #f0f0f0;
}

.sortable-chosen {
    transform: rotate(2deg) scale(1.02);
}

.sortable-drag {
    opacity: 0.8;
}

/* Add card styles */
.add-card {
    padding: 8px 12px;
    margin-top: auto;
}

.add-card-btn {
    width: 100%;
    padding: 8px;
    text-align: left;
    font-size: 14px;
    color: var(--light-text);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
}

.add-card-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.add-card-form {
    margin-top: 8px;
}

.new-card-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--modal-shadow);
}

.close-modal, .close-list-modal, .close-add-list-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: var(--light-text);
}

.close-modal:hover, .close-list-modal:hover, .close-add-list-modal:hover {
    color: var(--text-color);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:last-child td {
    border-bottom: none;
}

/* Notification styles */
.notification {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification i {
    font-size: 18px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .lists-container {
        flex-direction: column;
        align-items: center;
    }

    .list {
        width: 100%;
        margin-bottom: 20px;
    }

    .modal-content {
        width: 95%;
    }

    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
}


/* Add these styles to your existing CSS file */

/* Card with description styling */
.card.has-description {
    position: relative;
    padding-bottom: 20px; /* Make space for the indicator */
}

/* Description indicator */
.card-description-indicator {
    position: absolute;
    bottom: 5px;
    left: 8px;
    color: #6b6b6b;
    font-size: 12px;
}

/* Optional - add a subtle background color to cards with descriptions */
.card.has-description {
    background-color: #f9f9f9;
}

/* Make description area in modal look better */
#edit-card-description {
    min-height: 100px;
    font-family: inherit;
    padding: 8px;
    line-height: 1.5;
}









/* Add these styles to your existing CSS file */

/* Improve touch targets for mobile */
@media (max-width: 768px) {
    /* Make card buttons easier to tap */
    .card {
        padding: 12px 15px; /* Larger padding for better touch target */
        margin-bottom: 12px;
    }

    /* Make modal buttons more tappable */
    .btn {
        padding: 10px 16px;
        min-height: 44px; /* Apple's recommended minimum touch target size */
    }

    /* Larger close buttons for modals */
    .close-modal, .close-list-modal, .close-add-list-modal {
        font-size: 28px;
        padding: 10px;
        top: 10px;
        right: 10px;
    }

    /* Make sure modal content has enough space on mobile */
    .modal-content {
        padding: 20px;
        width: 90%;
        max-width: 90%;
    }

    /* Better form inputs for touch */
    input[type="text"],
    input[type="password"],
    textarea {
        padding: 12px;
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    /* More space between form elements */
    .form-group {
        margin-bottom: 20px;
    }

    /* Make card edit form more mobile-friendly */
    #edit-card-form {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    #edit-card-description {
        min-height: 120px; /* Larger textarea for mobile */
    }

    /* Space out form action buttons */
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn {
        width: 100%;
    }
}
