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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1428 100%);
    height: 100vh;
    overflow: hidden;
}

html {
    height: 100%;
    overflow: hidden;
}

.browser-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 48px;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    z-index: 1000;
}

.sidebar-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: rgba(99, 102, 241, 0.6);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    position: relative;
    border-radius: 8px;
}

.sidebar-btn:hover {
    color: rgba(99, 102, 241, 0.9);
    background: rgba(99, 102, 241, 0.1);
}

.sidebar-btn.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
}

.sidebar-btn.active::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #6366f1;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
}

.sidebar-spacer {
    flex: 1;
    min-height: 0;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: calc(100% - 48px);
    margin-left: 48px;
}

.tabs-container {
    display: flex;
    align-items: center;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    padding: 6px 10px;
    gap: 6px;
}

.tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.tabs::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

.tabs::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 100px;
    max-width: 180px;
    user-select: none;
}

.tab.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.tab.drag-over {
    border-left: 3px solid #6366f1;
}

.tab:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}

.tab.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.tab-icon {
    width: 18px;
    height: 18px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #6366f1;
    flex-shrink: 0;
}

.tab-icon-img {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

.tab-icon-fallback {
    display: none;
}

.tab-title {
    color: rgba(199, 210, 254, 0.8);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.tab.active .tab-title {
    color: rgba(199, 210, 254, 1);
}

.tab-close {
    background: transparent;
    border: none;
    color: rgba(199, 210, 254, 0.5);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tab-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.new-tab-btn {
    width: 28px;
    height: 28px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    color: rgba(99, 102, 241, 0.8);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.new-tab-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #6366f1;
    transform: translateY(-1px);
}

.toolbar {
    display: flex;
    align-items: center;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    padding: 8px 12px;
    gap: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(99, 102, 241, 0.1);
}

.nav-buttons {
    display: flex;
    gap: 6px;
}

.nav-buttons button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    cursor: pointer;
    color: rgba(99, 102, 241, 0.8);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-buttons button:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-buttons button:active {
    transform: translateY(0);
    background: rgba(99, 102, 241, 0.15);
}

.nav-buttons button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.address-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 8px 12px;
    gap: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.address-bar:focus-within {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 4px 20px rgba(0, 0, 0, 0.4);
}

.address-bar .lock-icon {
    color: rgba(99, 102, 241, 0.6);
    font-size: 12px;
}

#urlInput {
    flex: 1;
    border: none;
    background: transparent;
    color: rgba(199, 210, 254, 0.9);
    font-size: 13px;
    outline: none;
    padding: 0;
    font-weight: 400;
}

#urlInput::placeholder {
    color: rgba(99, 102, 241, 0.4);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    cursor: pointer;
    color: rgba(99, 102, 241, 0.8);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-buttons button:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#goBtn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    width: auto;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

#goBtn:hover {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

#framesContainer {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.tab-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
    display: none;
}

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

.tab-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: none;
    overflow: auto;
}

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

.tab-content > * {
    width: 100%;
}

.tab-content body {
    width: 100%;
    margin: 0;
    padding: 0;
}

.tab-content .header,
.tab-content .search-container {
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
}

/* Auth Modal */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.auth-modal-overlay.active {
    display: flex;
}

.auth-modal-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-modal-card h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fafafa;
}

.auth-modal-card p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
    font-size: 14px;
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fafafa;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.auth-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fafafa;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.auth-form.active {
    display: flex;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fafafa;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.auth-btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    background: rgba(99, 102, 241, 0.2);
    color: #fafafa;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: rgba(99, 102, 241, 0.3);
}

.mini-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px;
    background: rgba(10, 14, 39, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.mini-player-artwork {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.mini-player-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-player-info {
    flex: 1;
    min-width: 0;
    max-width: 150px;
}

.mini-player-title {
    font-size: 11px;
    font-weight: 600;
    color: #c7d2fe;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-artist {
    font-size: 10px;
    color: rgba(199, 210, 254, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-player-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.1);
    color: #c7d2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 10px;
}

.mini-player-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

.mini-player-btn.play {
    width: 28px;
    height: 28px;
    font-size: 12px;
}
