/* /public/css/medication.css */

.medication-container {
    padding: 2rem 1rem;
    padding-top: 0;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

.modal-actions {
    justify-content: center !important;
}

.medication-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
    align-items: flex-start;
}

.medication-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 300px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.user-header {
    border-bottom: 1px solid rgba(144, 202, 249, 0.2);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.user-name {
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-label {
    background: linear-gradient(135deg, #ffffff, #90caf9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.user-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px rgba(144, 202, 249, 0.4));
}

.user-med-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.med-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
    cursor: pointer;
}

.med-item:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(144, 202, 249, 0.15);
}

.med-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.med-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.med-item-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.expand-icon {
    font-size: 0.6rem;
    opacity: 0.4;
    transition: transform 0.2s;
    width: 12px;
}

.med-item.expanded .expand-icon {
    transform: rotate(180deg);
    opacity: 0.8;
}

.med-item-details {
    display: none;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.med-item.expanded .med-item-details {
    display: block;
    animation: slideDown 0.2s ease-out;
}

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

.med-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.med-dosage-pill {
    font-size: 0.75rem;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
    font-weight: 700;
}

.interval-update {
    font-size: 1rem;
    font-weight: 700;
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.med-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.taken-at-label {
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.med-item-actions {
    display: flex;
    gap: 0.5rem;
}

.med-item-actions button {
    width: 28px;
    height: 28px;
}

.modal-registry {
    max-width: 800px;
}

.modal-registry .modal-actions {
    display: none;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.75rem;
}

.data-table {
    background: rgba(0, 0, 0, 0.12);
}

.col-actions-header {
    width: 100px;
    text-align: center !important;
}

@media (max-width: 768px) {
    .medication-container {
        padding: 1rem;
    }

    .modal-registry {
        padding: 1.5rem 1rem;
    }

    .data-table {
        background: rgba(0, 0, 0, 0.12);
    }

    .data-table th {
        font-size: 0.65rem;
        padding: 0.6rem 0.25rem;
    }

    .data-table td {
        padding: 0.75rem 0.25rem;
        font-size: 0.85rem;
    }

    .col-actions .btn-icon-edit,
    .col-actions .btn-icon-delete {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .data-table th:first-child,
    .data-table td:first-child {
        padding-left: 1rem;
    }

    .manage-actions .btn-primary,
    .manage-actions .action-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .medication-grid {
        grid-template-columns: 1fr;
    }
}
