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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #2c3e50; /* fallback color */
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('Bg.jpeg') center/cover no-repeat;
    filter: blur(8px);
    z-index: -1;
}

.browser-window {
    width: 90vw;
    height: 85vh;
    max-width: 1200px;
    background: #f6f6f6;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.window-header {
    background: linear-gradient(180deg, #e8e8e8 0%, #d1d1d1 100%);
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid #b8b8b8;
    position: relative;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.control.close {
    background: #ff5f57;
}

.control.minimize {
    background: #ffbd2e;
}

.control.maximize {
    background: #28ca42;
}

.window-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 200px);
}

.nav-bar {
    background: #f6f6f6;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-controls {
    display: flex;
    gap: 4px;
}

.nav-button {
    background: #fff;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.nav-button:hover {
    background: #f0f0f0;
}

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

.home-button {
    margin-left: 4px;
}

.address-bar-container {
    flex: 1;
    display: flex;
    gap: 8px;
    position: relative;
}

.address-bar {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.address-bar:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.go-button {
    background: #007aff;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.go-button:hover {
    background: #0056b3;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 70px; /* Account for Go button width */
    background: white;
    border: 1px solid #d1d1d1;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.autocomplete-item:hover {
    background: #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-url {
    font-weight: 600;
    color: #333;
}

.autocomplete-title {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.content-area {
    flex: 1;
    position: relative;
    background: white;
}

.content-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.95);
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #007aff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.browser-window.fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

body.fullscreen {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

.history-button {
    background: none;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    margin-right: 4px;
}

.history-button:hover {
    color: #333;
    background: #f0f0f0;
}

.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.history-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
}

.history-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.history-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.history-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.history-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.website-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.website-item:hover {
    background: #f8f9fa;
    border-color: #007aff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.website-url {
    font-weight: 600;
    color: #007aff;
    font-size: 14px;
    margin-bottom: 4px;
}

.website-title {
    color: #333;
    font-size: 13px;
    margin-bottom: 4px;
}

.website-date {
    color: #666;
    font-size: 11px;
}

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

.empty-placeholder {
    text-align: center;
    color: #666;
    padding: 40px;
}

.empty-placeholder h3 {
    margin-bottom: 8px;
    color: #333;
}