:root {
    --primary: #F39C12;
    --secondary: #F1C40F;
    --accent: #E74C3C;
    --bg-dark: #1A1400;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #FFFFFF;
    --text-muted: #B2BEC3;
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 320px;
    min-width: 320px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.control-section {
    margin-bottom: 2rem;
}

.control-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-section h3 i {
    width: 16px;
    height: 16px;
}

/* Input Groups */
.input-group {
    display: flex;
    gap: 0.5rem;
}

input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

#apply-url {
    background: var(--primary);
    color: var(--bg-dark);
    width: 45px;
    flex-shrink: 0;
}

#apply-url:hover {
    background: var(--secondary);
    transform: translateY(-1px);
}

.resolution-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.btn-secondary {
    background: var(--bg-card);
    color: white;
    width: 100%;
    padding: 0.75rem;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

/* Presets */
.preset-group h4 {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem 0;
}

.preset-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preset-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    width: 100%;
    text-align: left;
}

.preset-btn:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.preset-btn.active {
    background: rgba(243, 156, 18, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.preset-btn .res {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #120E00;
}

.top-bar {
    height: 60px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.current-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.device-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.res-value {
    color: var(--primary);
    font-weight: 600;
}

.orientation-badge {
    background: rgba(243, 156, 18, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.separator {
    color: var(--border-color);
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.zoom-controls {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    padding: 0.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.view-controls button {
    background: var(--bg-card);
    color: white;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
}

.zoom-controls button {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
}

.view-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

#zoom-level {
    font-size: 0.85rem;
    min-width: 45px;
    text-align: center;
    font-weight: 600;
}

/* Preview Area */
.preview-area {
    flex: 1;
    padding: 3rem;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 24px 24px;
    position: relative;
}

.iframe-wrapper {
    position: relative;
    padding: 20px;
}

.iframe-container {
    background: white;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    transform-origin: top center;
    display: flex;
    flex-direction: column;
}

.iframe-header {
    height: 40px;
    background: #f1f1f1;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    flex-shrink: 0;
}

.browser-dots {
    display: flex;
    gap: 6px;
}

.browser-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.browser-dots span:nth-child(1) { background: #ff5f56; }
.browser-dots span:nth-child(2) { background: #ffbd2e; }
.browser-dots span:nth-child(3) { background: #27c93f; }

.browser-address {
    background: white;
    border-radius: 4px;
    flex: 1;
    height: 24px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    color: #666;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#preview-iframe {
    width: 100%;
    flex: 1;
    border: none;
    background: white;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
