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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

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

.header h1 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.privacy-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.privacy-icon {
    font-size: 1.2em;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.exercise-selector {
    margin-bottom: 20px;
}

.exercise-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

.exercise-selector select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s;
}

.exercise-selector select:focus {
    outline: none;
    border-color: #667eea;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: white;
}

.stat-card h3 {
    font-size: 0.9em;
    margin-bottom: 5px;
    opacity: 0.9;
}

.stat-card .value {
    font-size: 2em;
    font-weight: bold;
}

.workout-input {
    margin-bottom: 25px;
}

.workout-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

.workout-input input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    transition: border-color 0.3s;
}

.workout-input input:focus {
    outline: none;
    border-color: #667eea;
}

.button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 15px;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.button:active {
    transform: translateY(0);
}

.add-exercise-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.chart-container {
    height: 300px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.view-toggle-btn {
    flex: 1;
    padding: 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    color: #666;
}

.view-toggle-btn.active {
    background: #667eea;
    color: white;
}

.view-toggle-btn:hover:not(.active) {
    background: #e0e0e0;
}

.history-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workout-actions {
    display: flex;
    gap: 8px;
}

.edit-btn, .delete-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.2s;
}

.edit-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.delete-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

.history-item .date {
    font-weight: 600;
    color: #666;
}

.history-item .reps {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
}

.cancel-btn {
    background: #e0e0e0;
    color: #666;
}

.confirm-btn {
    background: #667eea;
    color: white;
}

.tab-buttons {
    display: flex;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 20px;
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.tab-button.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.no-data {
    text-align: center;
    color: #666;
    padding: 40px;
    font-style: italic;
}

.affiliate-banner {
    text-align: center;
    margin-top: 30px;
}

.affiliate-banner h4 {
    margin-bottom: 15px;
    color: #666;
    font-size: 1em;
}

.affiliate-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.affiliate-banner img:hover {
    transform: scale(1.02);
}

/* Fly-out Data Management Tab Styles */
.data-flyout {
    position: fixed;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    transition: all 0.3s ease;
}

.flyout-tab {
    background: rgba(102, 126, 234, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 20px 50px;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: 600;
    font-size: 13px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    user-select: none;
    line-height: 1.4;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
}

.flyout-tab:hover {
    background: rgba(102, 126, 234, 1);
    transform: translateX(-15px);
    box-shadow: -8px 0 20px rgba(0,0,0,0.4);
}

.flyout-panel {
    position: absolute;
    right: 100%;
    top: 0;
    width: 280px;
    background: white;
    border-radius: 12px 0 0 12px;
    padding: 25px;
    box-shadow: -5px 0 20px rgba(0,0,0,0.2);
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.data-flyout.open .flyout-panel {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.data-flyout.open .flyout-tab {
    background: rgba(102, 126, 234, 1);
    border-radius: 8px 0 0 8px;
}

.flyout-header {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flyout-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.flyout-btn {
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.backup-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.backup-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.3);
}

.restore-btn {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
}

.restore-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 193, 7, 0.3);
}

.flyout-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    color: #6c757d;
    font-size: 12px;
    line-height: 1.4;
    border-left: 3px solid #667eea;
}

.flyout-info strong {
    color: #495057;
}

.flyout-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: #adb5bd;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.2s;
}

.flyout-close:hover {
    color: #6c757d;
}

/* Overlay for mobile */
.flyout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.data-flyout.open .flyout-overlay {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .privacy-subtitle {
        font-size: 0.9em;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }

    .flyout-panel {
        width: 260px;
        padding: 20px;
    }

    .data-flyout {
        right: -25px;
    }

    .flyout-tab {
        padding: 15px 35px;
        font-size: 11px;
        min-height: 120px;
        width: 60px;
    }

    .affiliate-banner img {
        border-radius: 8px;
    }

    .affiliate-banner h4 {
        font-size: 0.9em;
    }
}
