/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f7;
    color: #333;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 30px;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #5469d4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.login-box button:hover {
    background: #4456c7;
}

.error {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Header */
header {
    background: white;
    padding: 16px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logout-btn {
    color: #5469d4;
    text-decoration: none;
    font-weight: 500;
}

/* Tabs */
.tabs {
    background: white;
    padding: 0 24px;
    border-bottom: 1px solid #e5e5e7;
}

.tab {
    background: none;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab:hover {
    color: #5469d4;
}

.tab.active {
    color: #5469d4;
    border-bottom-color: #5469d4;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Create Server Layout */
.create-server-container {
    display: flex;
    min-height: calc(100vh - 120px);
}

/* Left Panel */
.left-panel {
    width: 250px;
    background: #f5f5f7;
    padding: 24px;
}

.section-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.nav-item:hover {
    background: #e5e5e7;
}

.nav-item.active {
    background: #e3e6ff;
    color: #5469d4;
    font-weight: 500;
}

/* Center Panel */
.center-panel {
    flex: 1;
    padding: 32px;
    background: white;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section h2 {
    margin-bottom: 24px;
    font-size: 28px;
}

.section-description {
    margin-bottom: 32px;
    color: #666;
    line-height: 1.6;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #5469d4;
}

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #ddd;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    color: #666;
    cursor: help;
}

/* Size Input */
.size-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
}

.size-input {
    width: 100px;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* Flavor Section */
.flavor-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e5e7;
}

.flavor-tab {
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #666;
}

.flavor-tab.active {
    color: #333;
    border-bottom-color: #333;
}

.slider-container {
    margin-bottom: 32px;
}

.slider-group {
    margin-bottom: 24px;
}

.slider-group label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.slider-values {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

.slider {
    width: 100%;
    height: 4px;
    appearance: none;
    background: #e5e5e7;
    border-radius: 2px;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #5469d4;
    border-radius: 50%;
    cursor: pointer;
}

.flavor-list {
    display: grid;
    gap: 12px;
}

.flavor-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid #e5e5e7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.flavor-item:hover {
    border-color: #5469d4;
    background: #f8f9ff;
}

.flavor-item.selected {
    border-color: #5469d4;
    background: #e3e6ff;
}

.flavor-name {
    font-weight: 500;
    margin-right: 16px;
}

.flavor-type {
    flex: 1;
    color: #666;
    font-size: 14px;
}

.flavor-specs {
    color: #333;
    font-size: 14px;
}

/* Management Section */
.management-option {
    margin-bottom: 32px;
    padding: 24px;
    background: #f8f8fa;
    border-radius: 8px;
}

.management-option h3 {
    margin-bottom: 8px;
}

.management-option p {
    margin-bottom: 16px;
    color: #666;
    font-size: 14px;
}

.toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: #ddd;
    border-radius: 12px;
    position: relative;
    transition: background 0.3s;
    margin-right: 12px;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: #5469d4;
}

.toggle input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

/* Credentials Section */
.credential-box {
    margin-bottom: 24px;
    padding: 24px;
    background: #f8f8fa;
    border-radius: 8px;
}

.ssh-key-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 1px solid #e5e5e7;
    border-radius: 6px;
}

.key-icon {
    font-size: 20px;
}

.key-name {
    font-weight: 500;
}

.key-fingerprint {
    flex: 1;
    font-family: monospace;
    font-size: 12px;
    color: #666;
}

.key-date {
    color: #666;
    font-size: 14px;
}

/* Right Panel - Pricing */
.right-panel {
    width: 350px;
    padding: 32px 24px;
    background: #f8f8fa;
    border-left: 1px solid #e5e5e7;
}

.price-summary h3 {
    margin-bottom: 24px;
    font-size: 18px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e7;
}

.price-item.total {
    border-bottom: none;
    padding-top: 24px;
    font-weight: 600;
    font-size: 18px;
}

.price-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-select {
    background: transparent;
    border: none;
    cursor: pointer;
    appearance: none;
    padding-right: 20px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
}

.total-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-note {
    margin: 24px 0;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.price-note a {
    color: #5469d4;
    text-decoration: none;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: #e7d547;
    color: #333;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 12px;
}

.btn-primary:hover {
    background: #d4c43e;
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #f5f5f7;
}

/* Server Management */
.servers-container, .network-container {
    padding: 32px;
}

.toolbar {
    margin-bottom: 24px;
}

.toolbar .btn-primary, .toolbar .btn-secondary {
    width: auto;
    padding: 8px 16px;
    margin-right: 12px;
    margin-bottom: 0;
}

.servers-list {
    background: white;
    border-radius: 8px;
    padding: 24px;
}

.server-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e5e5e7;
}

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

.server-name {
    font-weight: 500;
    flex: 1;
}

.server-status {
    margin-right: 16px;
    padding: 4px 12px;
    background: #e7f3e7;
    color: #2e7d2e;
    border-radius: 4px;
    font-size: 14px;
}

/* Dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog {
    background: white;
    padding: 32px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
}

.dialog h3 {
    margin-bottom: 24px;
}

.dialog-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.dialog-buttons .btn-primary,
.dialog-buttons .btn-secondary {
    flex: 1;
    margin: 0;
}

/* Responsive */
@media (max-width: 1200px) {
    .create-server-container {
        flex-direction: column;
    }
    
    .left-panel,
    .right-panel {
        width: 100%;
    }
    
    .section-nav {
        flex-direction: row;
        overflow-x: auto;
    }
}