:root {
    /* GRND App Theme - Light minimalist */
    --primary: #1A1A1A;
    --background: #FAFAFA;
    --surface: #FFFFFF;
    --border: #E0E0E0;
    --border-light: #EEEEEE;
    --text-primary: #1A1A1A;
    --text-secondary: #5A5A5A;
    --text-hint: #9E9E9E;
    --font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    min-height: 100vh;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    padding-bottom: 100px;
    background-color: var(--background);
}

/* Header */
.header {
    background-color: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #FFFFFF;
}

.logo-text {
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 10px;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background-color: var(--primary);
    color: #FFFFFF;
    padding: 10px 20px;
    font-size: 14px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Main Content */
.main-content {
    padding: 20px 16px;
}

.state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Plan Header */
.plan-header {
    text-align: center;
    margin-bottom: 24px;
}

.badge {
    background-color: rgba(26, 26, 26, 0.08);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 12px;
}

.plan-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.plan-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--surface);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid var(--border);
}

.stat-item {
    padding: 0 20px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.stat-divider {
    width: 1px;
    height: 32px;
    background-color: var(--border);
}

/* Days List */
.days-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-wrapper {
    display: flex;
    flex-direction: column;
}

/* Day Card - Matches app dayCard style */
.day-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.day-card:hover {
    background-color: #F5F5F5;
}

.day-card:active {
    transform: scale(0.98);
}

.day-card.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: var(--border-light);
}

/* Day Card Image - Matches app dayCardImagePlaceholder */
.day-card-image {
    width: 60px;
    height: 60px;
    background-color: var(--background);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fitness-icon {
    width: 30px;
    height: 30px;
    color: var(--text-secondary);
}

/* Day Card Content - Matches app dayCardContent */
.day-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    align-items: flex-start;
}

.day-card-day {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.day-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Day Card Meta */
.day-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.exercise-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.chevron-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.chevron-icon.rotated {
    transform: rotate(90deg);
}

/* Exercise List - Expandable */
.exercise-list {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    overflow: hidden;
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.exercise-list.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Exercise Card - Matches app exerciseCard style */
.exercise-item {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.exercise-item:last-child {
    border-bottom: none;
}

/* Exercise Thumbnail - Matches app exerciseImage */
.exercise-thumb {
    width: 70px;
    height: 70px;
    background-color: var(--background);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exercise-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.barbell-icon {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
}

/* Exercise Info - Matches app exerciseCardInfo */
.exercise-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.exercise-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-exercises {
    padding: 32px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Bottom Action Bar */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 200;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.action-text {
    display: flex;
    flex-direction: column;
}

.action-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.action-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .app-container {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        margin-top: 24px;
        min-height: calc(100vh - 48px);
        border-radius: 16px;
        overflow: hidden;
    }

    .bottom-action-bar {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0 0 16px 16px;
    }
}
