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

body {
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.instagram-preview {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.phone-frame {
    width: 375px;
    height: 812px;
    background-color: #ffffff;
    border-radius: 40px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 10px solid #000;
}

.status-bar {
    height: 44px;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 14px;
    font-weight: bold;
}

.status-icons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.signal-icon, .battery-icon {
    height: 12px;
    margin: 0 2px;
}

.instagram-app {
    height: calc(100% - 44px);
    overflow-y: auto;
    background-color: #fff;
}

.app-header {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid #eee;
}

.back-icon {
    font-size: 24px;
}

.options-icon {
    font-size: 18px;
}

.profile-username {
    font-weight: bold;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.verified-badge {
    display: inline-flex;
    color: white;
    background-color: #3897f0;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    align-items: center;
    justify-content: center;
}

.profile-section {
    padding: 15px;
}

.profile-info {
    display: flex;
    margin-bottom: 15px;
}

.profile-picture {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background-color: #f0f0f0;
    margin-right: 25px;
    background-size: cover;
    background-position: center;
    border: 2px solid #e1306c;
    padding: 2px;
    background-clip: padding-box;
    position: relative;
    cursor: pointer;
}

.profile-picture-edit {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: #0095f6;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

.profile-stats {
    display: flex;
    flex-grow: 1;
    justify-content: space-around;
    align-items: center;
}

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

.stat-number {
    font-weight: bold;
    font-size: 18px;
}

.stat-label {
    font-size: 14px;
    color: #8e8e8e;
}

.profile-bio {
    margin-bottom: 15px;
}

.display-name {
    font-weight: bold;
    margin-bottom: 3px;
}

.bio-text {
    font-size: 14px;
    margin-bottom: 2px;
}

.bio-link {
    font-size: 14px;
    color: #00376b;
    margin-bottom: 5px;
}

.profile-badge {
    font-size: 14px;
    color: #8e8e8e;
    margin-bottom: 10px;
}

.profile-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.follow-button, .message-button, .email-button, .more-button {
    padding: 7px 10px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.follow-button {
    background-color: #0095f6;
    color: white;
    flex-grow: 1;
}

.follow-button.following {
    background-color: #0095f6;
    color: white;
}

.message-button, .email-button {
    background-color: #efefef;
    color: #000;
    flex-grow: 1;
}

.more-button {
    background-color: #efefef;
    color: #000;
    width: 35px;
}

.story-highlights {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
}

.highlight-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 65px;
    cursor: pointer;
}

.highlight-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    border: 1px solid #dbdbdb;
    font-size: 24px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.highlight-edit {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background-color: #0095f6;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid white;
}

.highlight-name {
    font-size: 12px;
    color: #262626;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 65px;
    text-align: center;
}

.highlight-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.highlight-button {
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    flex-grow: 1;
}

.add-highlight-button {
    background-color: #0095f6;
    color: white;
}

.remove-highlight-button {
    background-color: #ed4956;
    color: white;
}

.content-tabs {
    display: none;
}

.feed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    max-height: 530px;
    overflow-y: auto;
}

.feed-item {
    position: relative;
    aspect-ratio: 1/1;
    background-color: #fff;
    cursor: pointer;
}

.feed-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.image-overlay {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
}

.feed-item.selected .feed-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 149, 246, 0.3);
    border: 3px solid #0095f6;
}

.feed-item.empty {
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-image {
    font-size: 30px;
    color: #dbdbdb;
    cursor: pointer;
}

.bottom-nav {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 50px;
    background-color: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #dbdbdb;
}

.nav-item {
    font-size: 24px;
    color: #262626;
}

.nav-icon {
    width: 24px;
    height: 24px;
}

.instagram-footer {
    display: none;
}

.controls-panel {
    width: 400px;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.controls-panel h2 {
    margin-bottom: 20px;
    color: #262626;
    text-align: center;
}

.control-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #efefef;
    padding-bottom: 20px;
}

.control-section h3 {
    margin-bottom: 15px;
    color: #262626;
}

.control-item {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.control-item label {
    margin-bottom: 5px;
    font-size: 14px;
    color: #262626;
}

.control-item input[type="text"] {
    padding: 8px 10px;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
}

.control-item input[type="checkbox"] {
    margin-top: 5px;
}

.image-upload {
    margin-bottom: 15px;
}

.image-upload label {
    display: block;
    margin-bottom: 5px;
}

.image-upload input[type="file"] {
    width: 100%;
    padding: 8px 0;
}

.selected-actions {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.arrange-options, .preview-actions {
    display: flex;
    gap: 10px;
}

button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.delete-button {
    background-color: #ed4956;
    color: white;
}

.clear-button {
    background-color: #dbdbdb;
    color: #262626;
}

.rearrange-button {
    background-color: #0095f6;
    color: white;
    width: 100%;
}

.reset-button {
    background-color: #dbdbdb;
    color: #262626;
    flex-grow: 1;
}

.save-button {
    background-color: #0095f6;
    color: white;
    flex-grow: 1;
}

.tab-buttons {
    display: flex;
    margin-bottom: 15px;
}

.tab-button {
    flex: 1;
    padding: 8px;
    text-align: center;
    background-color: #f0f0f0;
    cursor: pointer;
}

.tab-button.active {
    background-color: #0095f6;
    color: white;
}

.preview-mode-button {
    background-color: #0095f6;
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    margin-top: 20px;
    cursor: pointer;
}

.preview-mode .controls-panel {
    display: none;
}

.preview-mode .phone-frame {
    margin: 0 auto;
}

.edit-mode-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #0095f6;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1000;
}

@media (max-width: 850px) {
    .instagram-preview {
        flex-direction: column;
    }
    
    .controls-panel {
        width: 100%;
        max-width: 400px;
        order: -1; 
    }
}