/* UI Transitions and Animations CSS */

/* General transitions */
.transition-all {
    transition: all 0.3s ease;
}

/* Fade animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale animations */
@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Shimmer loading effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Panel transitions */
.panel-enter {
    animation: fadeInUp 0.3s ease-out;
}

.panel-exit {
    animation: fadeOut 0.3s ease-in;
}

/* Button effects */
.button-press {
    transition: transform 0.1s ease;
}

.button-press:active {
    transform: scale(0.95);
}

/* Hover transitions for interactive elements */
.interactive-element {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.interactive-element:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Shimmer loading effect for content placeholders */
.shimmer-loading {
    background: linear-gradient(90deg, 
        #f0f0f0 0%, 
        #f8f8f8 20%, 
        #f0f0f0 40%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

/* Device frame transitions */
.device-frame {
    transition: width 0.3s ease-in-out, height 0.3s ease-in-out;
}

.iphone-outline {
    transition: border-radius 0.3s ease-in-out, width 0.3s ease-in-out, height 0.3s ease-in-out;
}

/* Tab transitions */
.swift-tab-button {
    transition: color 0.2s ease, border-bottom 0.2s ease;
}

.swift-tab-content {
    transition: opacity 0.2s ease;
}

/* Toggle animations */
.toggle-switch {
    transition: background-color 0.2s ease;
}

.toggle-knob {
    transition: left 0.2s ease;
}

/* File explorer animations */
.file-item, .folder-item {
    transition: background-color 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
}

.folder-name {
    transition: color 0.2s ease;
}

.file-tree ul {
    transition: height 0.3s ease, opacity 0.3s ease;
}

/* Chat animations */
.chat-message {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-input-area {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Enhanced button hover states */
.header-btn:hover, 
.chat-send-btn:hover, 
.accept-changes-btn:hover, 
.download-icon:hover {
    filter: brightness(1.1);
}

/* Device dropdown animation */
.device-dropdown {
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status bar animation */
.swift-ui-status-bar {
    animation: fadeIn 0.5s ease-in-out;
}

/* Spinner animation for loading states */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Navigation transitions */
.swift-navigation-bar {
    transition: background-color 0.3s ease;
}

/* Interaction ripple effect */
@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.8s;
}

.ripple-effect:active:after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Code editor styling */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

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

.copy-code-btn {
    background: none;
    border: none;
    color: #8b949e;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    color: #c9d1d9;
    background-color: #21262d;
}

.copy-code-btn:active {
    transform: scale(0.95);
}

/* Error handling styling for error messages */
.error-message-container {
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 6px;
    background-color: rgba(248, 81, 73, 0.1);
    border-left: 4px solid #f85149;
    color: #f85149;
    font-size: 14px;
}

.error-message-container .error-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.error-message-container .error-details {
    color: #c9d1d9;
}

/* Toast appearance animation */
.toast {
    transform-origin: top right;
}

.toast.toast-success {
    animation: toastSuccess 0.3s ease forwards;
}

@keyframes toastSuccess {
    0% {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    70% {
        transform: translateX(-5%) scale(1.05);
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* App Generation Pipeline Styles */
.template-selector h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #e6edf3;
}

.template-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.template-option {
    padding: 12px;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.template-option:hover {
    border-color: #2f81f7;
    transform: translateY(-2px);
}

.template-option.selected {
    border-color: #2f81f7;
    background-color: rgba(47, 129, 247, 0.1);
    box-shadow: 0 0 0 1px rgba(47, 129, 247, 0.4);
}

.template-name {
    font-weight: 600;
    font-size: 14px;
    color: #e6edf3;
    margin-bottom: 4px;
}

.template-description {
    font-size: 12px;
    color: #8b949e;
}

.generation-progress-container {
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.generation-step {
    position: relative;
}

.generation-step::after {
    content: '';
    position: absolute;
    top: 6px;
    left: calc(50% + 10px);
    width: calc(100% - 20px);
    height: 1px;
    background-color: #30363d;
    z-index: 0;
}

.generation-step:last-child::after {
    display: none;
}

.step-indicator {
    position: relative;
    z-index: 1;
} 