/* =======================================================
   FisioLink: Modern & Premium Exercise Plans Design System
   ======================================================= */

:root {
    --primary-color: #000428;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --bg-light: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.15);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 6px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.4);
}

.planes-wrapper {
    max-width: 750px;
    margin: 0 auto;
    padding: 16px;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
}

/* Back navigation header */
.planes-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.btn-back-arrow {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-back-arrow:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.fisiolink-mini-logo {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--accent-color);
    letter-spacing: 1px;
}

/* Create button & Section Headers */
.btn-create-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--accent-color);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background-color 0.2s, transform 0.1s;
    margin-bottom: 32px;
}

.btn-create-large:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-create-large:active {
    transform: translateY(1px);
}

.section-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-count {
    font-size: 0.85rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* Empty State */
.empty-routine-state {
    text-align: center;
    padding: 48px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
    color: var(--text-muted);
}

.empty-routine-state i {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 16px;
}

.empty-routine-state p {
    font-weight: 600;
    font-size: 1.05rem;
}

/* Sleek Plan List Cards */
.routine-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.routine-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(8px);
}

.routine-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.routine-info-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.routine-icon-box {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.routine-title-text {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.btn-options-trigger {
    background: none;
    border: none;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.btn-options-trigger:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* Options Dropdown Menu Overlay */
.options-dropdown-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100400;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.options-dropdown-menu {
    background: #001220;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
    max-width: 480px;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    animation: slideUpMenu 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpMenu {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.options-menu-header {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.options-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.options-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: var(--bg-light);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
}

.options-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.options-menu-item i {
    color: var(--text-muted);
    font-size: 1.1rem;
    width: 20px;
}

.options-menu-item.danger-item {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

.options-menu-item.danger-item:hover {
    background: rgba(239, 68, 68, 0.1);
}

.options-menu-item.danger-item i {
    color: var(--danger-color);
}

/* Detail View (Mockup 2) */
.detail-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
}

.detail-plan-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.share-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: block;
}

.share-link-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
    padding: 4px;
    margin-bottom: 24px;
}

.share-link-input {
    flex-grow: 1;
    border: none;
    background: none;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-copy-link {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-copy-link:hover {
    background: var(--accent-hover);
}

.btn-action-primary {
    width: 100%;
    background: var(--accent-color);
    color: white;
    font-weight: 600;
    padding: 14px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 12px;
    transition: background-color 0.2s;
}

.btn-action-primary:hover {
    background: var(--accent-hover);
}

.btn-action-outline {
    width: 100%;
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    padding: 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-action-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
}

/* Editor Form View (Mockup 3) */
.plan-form-container {
    display: flex;
    flex-direction: column;
}

.input-plan-title-large {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--border-color);
    font-size: 1.6rem;
    font-weight: 700;
    padding: 12px 0;
    outline: none;
    color: var(--text-primary);
    background: transparent;
    transition: border-color 0.2s;
    margin-bottom: 24px;
}

.input-plan-title-large:focus {
    border-color: var(--accent-color);
}

.textarea-plan-desc-large {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    resize: vertical;
    margin-bottom: 24px;
}

/* Form Exercise Cards */
.form-exercise-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 80px; /* Space for floating add button */
}

.form-exercise-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    backdrop-filter: blur(8px);
}

.btn-delete-card-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-card-icon:hover {
    background: rgba(239, 68, 68, 0.05);
}

.exercise-card-layout {
    display: flex;
    gap: 16px;
}

@media (max-width: 500px) {
    .exercise-card-layout {
        flex-direction: column;
    }
}

.gallery-thumbnail-box {
    width: 110px;
    height: 110px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s, background-color 0.2s;
    overflow: hidden;
    position: relative;
}

.gallery-thumbnail-box:hover {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.03);
}

.gallery-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-box-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.gallery-box-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.exercise-inputs-right {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ex-input-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.ex-input-field:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.12);
}

.ex-textarea-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #ffffff;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s, background-color 0.2s;
}

.ex-textarea-field:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.12);
}

.exercise-parameters-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
}

/* Floating Add Button */
.floating-add-wrapper {
    display: flex;
    justify-content: center;
    margin: 24px 0 32px 0;
}

.btn-floating-add {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-floating-add:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.btn-floating-add:active {
    transform: scale(0.95);
}

/* Editor Form Footer Actions */
.form-footer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

/* Gallery Modal (Mockup 4) */
/* Gallery & Assignment Modals */
.gallery-modal-overlay,
.plan-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 4, 40, 0.75);
    backdrop-filter: blur(6px);
    z-index: 100600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal,
.plan-modal {
    background: #001220;
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 95%;
    max-width: 500px;
    height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    animation: scaleUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: #ffffff;
}

.plan-modal {
    height: auto;
    max-height: 90vh;
}

@keyframes scaleUpModal {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.gallery-modal-header,
.plan-modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gallery-modal-title,
.plan-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.plan-modal-close:hover {
    color: #ffffff;
}

.gallery-search-box {
    position: relative;
    width: 100%;
}

.gallery-search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.gallery-search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    outline: none;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transition: border-color 0.2s, background-color 0.2s;
}

.gallery-search-input:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

/* Category Tabs inside Gallery */
.gallery-category-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 20px 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.gallery-category-bar::-webkit-scrollbar {
    height: 4px;
}

.gallery-category-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.gallery-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.65);
    transition: all 0.2s;
}

.gallery-tab-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

.gallery-tab-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.gallery-modal-body,
.plan-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s, background-color 0.2s;
    text-align: center;
    height: 100%;
    justify-content: flex-start;
}

.gallery-item:hover {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.06);
}

.gallery-item.selected {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.15);
}

.gallery-item-media {
    width: 100%;
    height: 110px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: white;
}

.gallery-item-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gallery-item-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: #ffffff;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.4em;
}

.gallery-item-sub {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-modal-footer,
.plan-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex-shrink: 0;
}

/* Patient selection list inside assign modal */
.patient-select-list {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
}

.patient-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 4px;
    transition: background-color 0.2s;
    color: #ffffff;
}

.patient-select-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.patient-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.patient-select-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.patient-select-info {
    flex-grow: 1;
}

.patient-select-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
}

.patient-select-email {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   Patient Assigned Exercise Plans Views Styles
   ========================================================================== */

.patient-plan-details {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.exercises-list-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.exercise-item-view {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: transform 0.2s, border-color 0.2s;
}

.exercise-item-view:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.3);
}

.exercise-item-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
}

.exercise-item-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    text-transform: capitalize;
}

.exercise-tag-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.exercise-tag {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.exercise-tag strong {
    color: #ffffff;
}

.exercise-view-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 12px 0;
    white-space: pre-line;
}

.exercise-media-preview {
    width: 100%;
    max-width: 380px;
    height: auto;
    max-height: 240px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: block;
    margin: 15px 0 0 0;
    object-fit: contain;
}

.btn-plan {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, transform 0.1s;
    font-size: 0.9rem;
}

.btn-plan-primary {
    background: linear-gradient(135deg, var(--accent-color), #2563eb);
    color: #ffffff;
}

.btn-plan-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}
