/* Simulator Styling */
.simulator-section {
    background-color: var(--background-secondary);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
}

.simulator-header {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.simulator-description {
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1em;
    line-height: 1.6;
}

.controls-title {
    font-size: 1.1em;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-weight: 500;
}

/* URL Input Area */
.url-input-container {
    margin-bottom: var(--spacing-xl);
    background-color: var(--background-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.url-input-wrapper {
    display: flex;
    gap: var(--spacing-sm);
    margin: var(--spacing-sm) 0;
}

.url-input-container label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-primary);
}

#website-url {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1em;
    transition: border-color var(--transition-fast);
}

#website-url:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--glow-color);
}

.load-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: background-color var(--transition-fast);
}

.load-btn:hover {
    background-color: var(--primary-hover);
}

.url-note {
    margin-top: var(--spacing-sm);
    font-size: 0.9em;
    color: var(--text-muted);
    font-style: italic;
}

/* Device Buttons */
.simulator-controls {
    margin-bottom: var(--spacing-xl);
    background-color: var(--background-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.device-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.device-buttons button {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--background-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9em;
    transition: all var(--transition-fast);
}

.device-buttons button:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.device-buttons button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Custom Size Controls */
.simulator-custom-controls {
    margin-bottom: var(--spacing-xl);
    background-color: var(--background-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.custom-size-inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.input-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.input-group label {
    font-weight: 500;
    color: var(--text-primary);
}

.input-group input {
    width: 80px;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--glow-color);
}

#apply-custom-size {
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: background-color var(--transition-fast);
}

#apply-custom-size:hover {
    background-color: var(--primary-hover);
}

.rotate-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    background-color: var(--background-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.rotate-btn:hover {
    background-color: var(--border-hover);
    border-color: var(--border-hover);
}



/* Preview Area */
.simulator-preview {
    margin-top: var(--spacing-xl);
    overflow: visible; /* Changed from hidden to visible for resize handles */
    background-color: var(--background-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: var(--spacing-lg);
}

/* Resizable iframe styles */
#simulator-frame-wrapper {
    position: relative;
    display: inline-block;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: visible; /* Changed to visible to show resize handles */
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Show handles on hover */
#simulator-frame-wrapper:hover .resize-handle {
    opacity: 0.8 !important;
}

/* Base resize handle styles - optimized for maximum performance */
.resize-handle {
    position: absolute;
    background: #007bff;
    opacity: 0.5;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    z-index: 1001;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
    /* No transitions for immediate response */
    will-change: opacity, background-color;
    pointer-events: auto;
}

.resize-handle:hover {
    opacity: 0.8;
    background: #0056b3;
    box-shadow: 0 2px 12px rgba(0, 86, 179, 0.25);
}

.resize-handle:active {
    opacity: 1;
    background: #004085;
    box-shadow: 0 1px 6px rgba(0, 64, 133, 0.3);
}

/* Southeast corner handle (diagonal resize) */
.resize-se {
    width: 16px;
    height: 16px;
    bottom: -8px;
    right: -8px;
    border-radius: 50%;
    cursor: se-resize;
    background: linear-gradient(135deg, #007bff, #0056b3);
}

/* East edge handle (horizontal resize) */
.resize-e {
    width: 8px;
    height: calc(100% - 16px);
    top: 8px;
    right: -4px;
    border-radius: 4px;
    cursor: e-resize;
}

/* South edge handle (vertical resize) */
.resize-s {
    width: calc(100% - 16px);
    height: 8px;
    bottom: -4px;
    left: 8px;
    border-radius: 4px;
    cursor: s-resize;
}

/* Add visual feedback during resize */
.resizing {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: inherit !important;
}

.resizing * {
    pointer-events: none;
}

/* Performance optimizations for dragging */
.resizing #simulator-frame {
    pointer-events: none;
    will-change: width, height;
}

.resizing .resize-handle {
    will-change: opacity, background-color;
}

/* Improve iframe styling */
#simulator-frame {
    border: none;
    display: block;
    background: #fff;
}

#simulator-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all var(--transition-medium);
}

#simulator-size-display {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-size: 0.9em;
}

#simulator-frame-wrapper {
    position: relative;
    transition: all var(--transition-medium);
    max-width: 100%;
    overflow: auto;
}

#simulator-frame {
    border: 1px solid var(--border-color);
    background-color: white;
    /* Remove transitions for immediate resize response */
    box-sizing: border-box;
    min-height: 300px;
    min-width: 320px;
    max-width: 100%;
}



/* Blog Article Enhancements */
.cta-box {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin: 2rem 0;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.cta-box h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.cta-box p {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    opacity: 0.95;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    background: white;
    color: #007bff;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
    color: #0056b3;
}

.author-bio {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    border-left: 4px solid #007bff;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid #007bff;
}

.author-bio h4 {
    margin: 0 0 0.5rem 0;
    color: #007bff;
    font-size: 1.3rem;
    font-weight: 600;
}

.author-bio p {
    margin: 0;
    color: #6c757d;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Blog image styling */
.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.blog-content img + em {
    display: block;
    text-align: center;
    font-style: italic;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .simulator-description {
        font-size: 1em;
    }
    
    .cta-box {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .cta-box h3 {
        font-size: 1.3rem;
    }
    
    .cta-box p {
        font-size: 1rem;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .author-avatar {
        align-self: center;
    }
    
    .url-input-wrapper {
        flex-direction: column;
    }
    
    .load-btn {
        width: 100%;
    }
    
    .device-buttons button {
        flex-basis: calc(50% - var(--spacing-sm));
    }
    
    .custom-size-inputs {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .input-group {
        width: 100%;
    }
    
    #apply-custom-size, .rotate-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .device-buttons button {
        flex-basis: 100%;
    }
    
    .simulator-preview {
        padding: var(--spacing-sm);
    }
    
    #simulator-frame {
        min-height: 200px;
    }
} 