/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f8f8f8;
    padding: 20px;
    color: #333;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

header p {
    color: #666;
}

.prototype-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.screen-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.screen-wrapper h3 {
    margin-bottom: 10px;
    font-weight: 500;
}

.iphone-frame {
    width: 390px;
    height: 844px;
    background-color: #1a1a1a;
    border-radius: 55px;
    padding: 12px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.iphone-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 44px;
    overflow: hidden;
    background-color: #fff;
}

footer {
    text-align: center;
    margin-top: 50px;
    color: #666;
    font-size: 14px;
}

/* iOS UI Components */
/* These styles will be used in individual pages */

/* Status bar */
.ios-status-bar {
    height: 44px;
    background-color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    color: white;
    font-size: 14px;
    position: relative;
}

.ios-status-bar .time {
    font-weight: 600;
}

.ios-status-bar .right-icons {
    display: flex;
    gap: 5px;
}

/* Tab bar */
.ios-tab-bar {
    height: 84px; /* includes safe area at bottom */
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding-bottom: 30px; /* Safe area */
    backdrop-filter: blur(10px);
}

.ios-tab-bar a {
    color: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.7;
}

.ios-tab-bar a.active {
    opacity: 1;
}

.ios-tab-bar i {
    font-size: 24px;
    margin-bottom: 2px;
}

.ios-tab-bar span {
    font-size: 10px;
}

/* TikTok-specific styles */
.video-container {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

.video-actions {
    position: absolute;
    right: 15px;
    bottom: 150px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-actions .action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-size: 13px;
}

.video-actions i {
    font-size: 32px;
    margin-bottom: 5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.video-info {
    position: absolute;
    left: 15px;
    bottom: 100px;
    color: white;
    max-width: 70%;
}

.video-info h3 {
    font-size: 17px;
    margin-bottom: 5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.video-info p {
    font-size: 15px;
    margin-bottom: 10px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.music-info {
    display: flex;
    align-items: center;
    font-size: 14px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.music-info i {
    margin-right: 5px;
}

/* Header & Navigation */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: transparent;
    position: relative;
    z-index: 10;
}

.app-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.app-header .header-icons {
    display: flex;
    gap: 15px;
}

.app-header .header-icon {
    font-size: 22px;
}

/* Page specific utilities */
.content-container {
    height: calc(100vh - 44px - 84px);
    overflow-y: auto;
    position: relative;
    background-color: #fff;
    -webkit-overflow-scrolling: touch;
}

/* Profile page */
.profile-header {
    padding: 20px;
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    object-fit: cover;
    border: 2px solid #f1f1f1;
}

.profile-username {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-count {
    font-weight: 600;
    font-size: 18px;
}

.stat-label {
    font-size: 13px;
    color: #666;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.profile-btn {
    padding: 8px 20px;
    border-radius: 2px;
    font-weight: 600;
    font-size: 14px;
}

.primary-btn {
    background-color: #fe2c55;
    color: white;
    border: none;
}

.secondary-btn {
    background-color: transparent;
    border: 1px solid #ddd;
}

/* Discover page */
.search-bar {
    display: flex;
    align-items: center;
    background-color: #f1f1f1;
    border-radius: 20px;
    padding: 8px 15px;
    margin: 15px;
}

.search-bar i {
    color: #999;
    margin-right: 10px;
}

.search-input {
    border: none;
    background: transparent;
    flex-grow: 1;
    font-size: 16px;
    outline: none;
}

.trending-section {
    margin: 20px 15px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.trending-carousel {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}

.trending-item {
    flex: 0 0 auto;
    width: 150px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f8f8;
}

.trending-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.trending-info {
    padding: 10px;
}

.trending-info h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.trending-info p {
    font-size: 12px;
    color: #666;
}

/* Video grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background-color: #f1f1f1;
}

.video-grid-item {
    aspect-ratio: 2/3;
    background-color: #ddd;
    position: relative;
}

.video-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-views {
    position: absolute;
    bottom: 5px;
    left: 5px;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.video-views i {
    font-size: 12px;
    margin-right: 3px;
}

/* Messages page */
.chat-list {
    display: flex;
    flex-direction: column;
}

.chat-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    align-items: center;
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.chat-details {
    flex-grow: 1;
}

.chat-username {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 3px;
}

.chat-preview {
    font-size: 14px;
    color: #666;
}

.chat-time {
    font-size: 12px;
    color: #999;
}

/* Chat page */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 44px - 84px);
}

.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 16px;
    position: relative;
    margin-bottom: 10px;
}

.message.received {
    background-color: #f1f1f1;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.message.sent {
    background-color: #3478f6;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.message-time {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-top: 5px;
}

.chat-input {
    display: flex;
    padding: 10px 15px;
    background-color: #f8f8f8;
    align-items: center;
    border-top: 1px solid #ddd;
}

.chat-input input {
    flex-grow: 1;
    border: none;
    background-color: white;
    padding: 10px 15px;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 16px;
    outline: none;
}

.chat-input button {
    background-color: #fe2c55;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Create page */
.camera-view {
    position: relative;
    height: calc(100% - 150px);
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.camera-view img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.camera-modes {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}

.camera-mode {
    color: white;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.7;
}

.camera-mode.active {
    opacity: 1;
    text-decoration: underline;
    font-weight: 600;
}

.camera-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.side-action {
    color: white;
    font-size: 24px;
    opacity: 0.9;
}

.record-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid white;
    background-color: #fe2c55;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-tools {
    position: absolute;
    right: 15px;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.camera-tool {
    color: white;
    font-size: 24px;
    background-color: rgba(0, 0, 0, 0.5);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Video editor page */
.editor-preview {
    height: 50%;
    position: relative;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.editor-timeline {
    height: 80px;
    background-color: #111;
    display: flex;
    align-items: center;
    padding: 0 15px;
    overflow-x: auto;
    gap: 5px;
}

.timeline-frame {
    height: 60px;
    width: 40px;
    background-color: #333;
    border-radius: 3px;
    flex-shrink: 0;
}

.editor-tools {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
}

.editor-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 13px;
}

.editor-tool i {
    font-size: 24px;
    margin-bottom: 5px;
}

.editor-options {
    padding: 15px;
    height: calc(100% - 50% - 80px - 50px - 60px);
    overflow-y: auto;
}

.editor-option {
    padding: 15px 0;
    border-bottom: 1px solid #f1f1f1;
}

.option-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.option-controls {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.option-item {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    background-color: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.editor-actions {
    display: flex;
    justify-content: space-between;
    padding: 15px;
}

.editor-actions button {
    padding: 10px 20px;
    border-radius: 3px;
    font-weight: 500;
    font-size: 16px;
}

/* Notifications page */
.notification-tabs {
    display: flex;
    border-bottom: 1px solid #f1f1f1;
}

.notification-tab {
    flex: 1;
    text-align: center;
    padding: 15px 0;
    font-weight: 500;
}

.notification-tab.active {
    color: #fe2c55;
    border-bottom: 2px solid #fe2c55;
}

.notification-list {
    display: flex;
    flex-direction: column;
}

.notification-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    align-items: center;
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.notification-content {
    flex-grow: 1;
}

.notification-text {
    font-size: 14px;
    margin-bottom: 3px;
}

.notification-username {
    font-weight: 600;
}

.notification-time {
    font-size: 12px;
    color: #999;
}

.notification-action {
    margin-left: 15px;
}

.notification-button {
    padding: 5px 15px;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #fe2c55;
    color: #fe2c55;
    background-color: white;
}

/* Settings page */
.settings-list {
    margin-top: 15px;
}

.settings-group {
    margin-bottom: 30px;
}

.settings-group-title {
    padding: 10px 15px;
    font-size: 14px;
    color: #999;
    background-color: #f8f8f8;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    align-items: center;
}

.settings-item-left {
    display: flex;
    align-items: center;
}

.settings-item-icon {
    width: 30px;
    margin-right: 15px;
    font-size: 20px;
    color: #555;
}

.settings-item-title {
    font-size: 16px;
}

.settings-item-right {
    color: #999;
    display: flex;
    align-items: center;
}

.settings-item-value {
    margin-right: 10px;
    font-size: 15px;
}

.settings-divider {
    height: 10px;
    background-color: #f8f8f8;
}