/* FitTrack Pro - Fitness App Demo */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* App Colors */
    --primary: #FF5A5F;
    --primary-dark: #E64046;
    --primary-light: #FF8B8F;
    --secondary: #4A6FFF;
    --secondary-dark: #3A5FEF;
    --secondary-light: #7A9FFF;
    --accent: #00C9A7;
    --accent-dark: #00B090;
    --accent-light: #40E9C7;
    --dark: #1A202C;
    --gray-dark: #4A5568;
    --gray: #718096;
    --gray-light: #A0AEC0;
    --gray-lighter: #E2E8F0;
    --light: #F7FAFC;
    --white: #FFFFFF;
    --red: #F56565;
    --orange: #ED8936;
    --yellow: #F6AD55;
    --green: #48BB78;
    --teal: #38B2AC;
    --blue: #4299E1;
    --indigo: #667EEA;
    --purple: #9F7AEA;
    --pink: #ED64A6;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* iOS Frame Dimensions */
    --frame-width: 375px;
    --frame-height: 812px;
    --frame-radius: 40px;
    --status-bar-height: 44px;
    --bottom-bar-height: 83px;
    --content-height: calc(var(--frame-height) - var(--status-bar-height) - var(--bottom-bar-height));
    
    /* Animations */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-primary);
    font-size: 16px;
    color: var(--dark);
    background-color: #f0f2f5;
    line-height: 1.6;
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Back to Portfolio Button */
.back-to-portfolio {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: var(--transition);
}

.back-to-portfolio:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* iOS Frame */
.ios-frame {
    width: var(--frame-width);
    height: var(--frame-height);
    background-color: var(--white);
    border-radius: var(--frame-radius);
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 
                0 0 0 1px rgba(0, 0, 0, 0.05),
                inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.9); /* Show entire frame without scrolling on most screens */
}

/* iOS Status Bar */
.ios-status-bar {
    height: var(--status-bar-height);
    background-color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    position: relative;
    z-index: 10;
}

.status-left {
    font-weight: 600;
    font-size: 15px;
}

.notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 30px;
    background-color: var(--dark);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 11;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-right i {
    font-size: 14px;
}

/* App Content */
.app-content {
    height: var(--content-height);
    overflow-y: auto;
    position: relative;
    -webkit-overflow-scrolling: touch; /* For iOS momentum scrolling */
    background-color: var(--light);
}

/* App Screens */
.screen {
    display: none;
    height: 100%;
    width: 100%;
    overflow-y: auto;
    position: absolute;
    top: 0;
    left: 0;
    padding-bottom: 30px; /* Extra padding at bottom for better scrolling */
}

.screen.active {
    display: block;
}

/* Home Screen */
#home-screen {
    background-color: var(--light);
}

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

.welcome-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark);
}

.welcome-text p {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
}

.highlight {
    color: var(--primary);
}

.profile-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--white);
}

.profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stats Overview */
.stats-overview {
    padding: 0 20px 20px;
}

.date {
    margin-bottom: 15px;
}

.date h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
}

.date p {
    font-size: 14px;
    color: var(--gray);
}

.daily-stats {
    background-color: var(--white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.stat-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-lighter);
}

.stat-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--white);
    font-size: 18px;
}

.stat-icon.steps {
    background-color: var(--blue);
}

.stat-icon.calories {
    background-color: var(--orange);
}

.stat-icon.active-time {
    background-color: var(--purple);
}

.stat-data {
    flex: 1;
}

.stat-data h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 2px;
}

.stat-data p {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
}

.progress-ring {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring-background {
    fill: none;
    stroke: var(--gray-lighter);
    stroke-width: 3;
}

.progress-ring-circle {
    fill: none;
    stroke: var(--blue);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 94.2; /* 2 * π * r (15) */
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.5s ease;
}

.calories-ring {
    stroke: var(--orange);
}

.time-ring {
    stroke: var(--purple);
}

.progress-ring span {
    position: absolute;
    font-size: 10px;
    font-weight: 700;
}

/* Section Headers */
.section-header {
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.btn-secondary {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    color: var(--primary-dark);
}

/* Workout Plan */
.workout-plan {
    padding: 0 20px;
    display: flex;
    overflow-x: auto;
    gap: 15px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scroll-behavior: smooth;
    padding-bottom: 10px; /* Add padding for scrollbar */
}

.workout-plan::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.workout-card {
    min-width: 280px;
    background-color: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: var(--transition);
}

.workout-card:hover, .workout-card.active {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.workout-image {
    height: 150px;
    position: relative;
}

.workout-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.workout-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary);
    color: var(--white);
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.workout-details {
    padding: 15px;
}

.workout-details h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.workout-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--gray);
}

.workout-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.workout-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.progress-bar {
    height: 6px;
    background-color: var(--gray-lighter);
    border-radius: 3px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.workout-progress span {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
    text-align: right;
}

/* Activity Timeline */
.activity-timeline {
    padding: 0 20px;
    margin-bottom: 20px;
}

.timeline-item {
    display: flex;
    align-items: center;
    background-color: var(--white);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.timeline-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
}

.timeline-content {
    flex: 1;
}

.timeline-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.timeline-content p {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 5px;
}

.timeline-time {
    font-size: 12px;
    color: var(--gray-light);
    font-weight: 500;
}

.timeline-badge {
    padding: 5px 10px;
    border-radius: 12px;
    background-color: var(--green);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
}

/* Workout Screen */
#workout-screen {
    background-color: var(--light);
}

.workout-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-lighter);
}

.workout-header h1 {
    font-size: 18px;
    font-weight: 700;
}

.btn-back, .btn-more {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-back:hover, .btn-more:hover {
    background-color: var(--gray-lighter);
}

.workout-hero {
    position: relative;
    height: 200px;
}

.workout-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.workout-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px;
    display: flex;
    justify-content: space-between;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--white);
    font-size: 14px;
}

.info-item i {
    margin-bottom: 5px;
    font-size: 18px;
}

.workout-progress-overview {
    padding: 20px;
    background-color: var(--white);
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
}

.workout-progress-overview h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray);
}

.exercises-list {
    padding: 0 20px;
}

.exercises-list h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.exercise-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: var(--white);
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.exercise-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
}

.exercise-check {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-color: var(--gray-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
}

.exercise-item.completed .exercise-check {
    background-color: var(--green);
    color: var(--white);
}

.exercise-item.active .exercise-check {
    background-color: var(--primary);
    color: var(--white);
}

.exercise-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    margin-right: 15px;
}

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

.exercise-details {
    flex: 1;
}

.exercise-details h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 3px;
}

.exercise-details p {
    font-size: 13px;
    color: var(--gray);
}

.exercise-actions {
    color: var(--primary);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.exercise-actions:hover {
    color: var(--primary-dark);
    transform: scale(1.1);
}

.workout-actions {
    padding: 20px;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    border-radius: 15px;
    background-color: var(--primary);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* iOS Tab Bar */
.ios-tab-bar {
    height: var(--bottom-bar-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: var(--white);
    border-top: 1px solid var(--gray-lighter);
    padding-bottom: 25px; /* For home indicator area */
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 0;
    width: 60px;
    transition: var(--transition);
    cursor: pointer;
}

.tab-item i {
    font-size: 22px;
    color: var(--gray);
    margin-bottom: 4px;
    transition: var(--transition);
}

.tab-item span {
    font-size: 11px;
    color: var(--gray);
    transition: var(--transition);
}

.tab-item.active i, .tab-item.active span {
    color: var(--primary);
}

.tab-plus {
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    margin-top: -20px; /* Pull up above tab bar */
}

.tab-plus:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* Responsive Adjustments */
@media (max-height: 820px) {
    .ios-frame {
        transform: scale(0.8);
    }
}

@media (max-height: 720px) {
    .ios-frame {
        transform: scale(0.7);
    }
}

@media (max-width: 400px) {
    .ios-frame {
        transform: scale(0.7);
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}