/* css/card.css */
/* Card-specific styles, prefixed with card- to avoid conflicts */
.card-container {
    display: flex;
    flex-direction: row; /* Keep row layout for all screen sizes */
    align-items: center;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem auto;
    max-width: 700px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-family: 'Roboto', sans-serif;
    color: #e0e0e0;
    position: relative;
    width: 100%; /* Ensure full width on all devices */
}

.card-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-right: 1.5rem;
}

.card-details {
    flex-grow: 1;
}

.card-details p {
    margin: 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 400;
}

.card-details .card-amount {
    font-weight: 500;
    color: #ffffff; /* White for "Amount:" */
}

.card-details .card-amount-value {
    font-weight: 500;
    color: #90EE90; /* Light green for "+ ₱amount" */
}

.card-details .card-paid {
    font-size: 0.9rem;
    color: #a0a0a0;
}

.card-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 1rem;
}

.card-action-button {
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
}

.card-action-button.approve {
    background: #28a745; /* Green background */
    color: #ffffff; /* White text */
}

.card-action-button.cancel {
    background: #4a4a4a;
    color: #e0e0e0;
}

.card-action-button.edit {
    background: #ffffff;
    color: #000000;
}

.card-action-button.delete {
    background: #ff4444; /* Red background for delete button */
    color: #ffffff;
}

.card-action-message {
    position: absolute;
    bottom: 0.5rem;
    right: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-action-message.success {
    color: #ffffff;
}

.card-action-message.error {
    color: #ff4444;
}

.card-action-message img {
    width: 16px;
    height: 16px;
}

.card-action-loader {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0026bb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (min-width: 769px) {
    .card-action-button:hover:not(:disabled) {
        background: #e0e0e0;
    }
    .card-action-button.approve:hover:not(:disabled) {
        background: #218838; /* Darker green on hover */
    }
    .card-action-button.cancel:hover:not(:disabled) {
        background: #5a5a5a;
    }
    .card-action-button.delete:hover:not(:disabled) {
        background: #cc0000; /* Darker red on hover */
    }
}

@media (max-width: 768px) {
    .card-container {
        flex-direction: row; /* Maintain row layout on mobile */
        align-items: center; /* Align items vertically centered */
        max-width: 100%; /* Full width on mobile */
        padding: 1rem;
        box-sizing: border-box;
    }
    .card-image {
        width: 60px;
        height: 60px;
        margin-right: 1rem; /* Reduced margin for mobile */
        margin-bottom: 0; /* Remove bottom margin */
    }
    .card-details {
        flex-grow: 1;
        text-align: left; /* Keep left-aligned text for consistency with desktop */
    }
    .card-details p {
        font-size: 1rem;
    }
    .card-details .card-paid {
        font-size: 0.8rem;
    }
    .card-action-buttons {
        flex-direction: column; /* Keep buttons stacked vertically */
        margin-left: 1rem;
        margin-top: 0; /* Remove top margin */
        width: auto; /* Allow buttons to size naturally */
        align-items: flex-start; /* Align buttons to the left */
    }
    .card-action-button {
        width: auto; /* Buttons size to content */
        min-width: 70px; /* Slightly smaller min-width */
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    .card-action-message {
        position: static;
        margin-top: 0.5rem;
        right: auto;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .card-container {
        padding: 0.75rem;
    }
    .card-image {
        width: 50px;
        height: 50px;
        margin-right: 0.75rem;
    }
    .card-details p {
        font-size: 0.9rem;
    }
    .card-details .card-paid {
        font-size: 0.7rem;
    }
    .card-action-buttons {
        margin-left: 0.75rem;
    }
    .card-action-button {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        min-width: 60px;
    }
}