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

body {
    font-family: 'Segoe UI', 'Malgun Gothic', sans-serif;
    background: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

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

.sidebar {
    width: 260px;
    background: #f9f9f9;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.sidebar-top {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.new-chat-btn {
    width: 100%;
    padding: 10px;
    background: #4a90d9;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.new-chat-btn:hover {
    background: #357abd;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.history-item-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.history-item {
    flex: 1;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
}

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

.history-item.active {
    background: #e3f2fd;
    border-color: #4a90d9;
    font-weight: bold;
}

.menu-container {
    position: relative;
}

.menu-btn {
    background: none;
    border: none;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 15px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item.delete {
    color: #d32f2f;
}

.sidebar-footer {
    padding: 15px;
    font-size: 11px;
    color: #888;
    border-top: 1px solid #e0e0e0;
    line-height: 1.5;
}

.reset-btn {
    width: 100%;
    margin-top: 12px;
    padding: 8px 12px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.reset-btn:hover {
    background: #ee5a5a;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.header {
    padding: 15px 20px;
    background: #4a90d9;
    color: white;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-info {
    font-size: 14px;
    font-weight: normal;
}

.logout-btn {
    padding: 6px 12px;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: normal;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.message-row {
    display: flex;
    margin-bottom: 15px;
}

.message-row.user {
    justify-content: flex-end;
}

.message-row.assistant {
    justify-content: flex-start;
}

.bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.bubble.user {
    background: #4a90d9;
    color: white;
    border-bottom-right-radius: 4px;
}

.bubble.assistant {
    background: white;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
}

.input-row textarea:focus {
    outline: none;
    border-color: #4a90d9;
}

.input-row button {
    padding: 12px 24px;
    background: #4a90d9;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.input-row button:hover {
    background: #357abd;
}

.download-section {
    margin-top: 15px;
    padding: 15px;
    background: #f0f7ff;
    border-radius: 8px;
    border: 1px solid #c2e0ff;
}

.download-btn {
    display: inline-block;
    margin: 5px 5px 5px 0;
    padding: 10px 16px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
}

.download-btn:hover {
    background: #43a047;
}

.approve-section {
    margin-top: 15px;
    text-align: center;
}

.approve-btn {
    padding: 12px 30px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.approve-btn:hover {
    background: #1976D2;
}

.approve-btn:disabled {
    background: #90CAF9;
    cursor: not-allowed;
}

.deploy-result-box {
    background: #E8F5E9;
    border: 1px solid #A5D6A7;
    border-radius: 8px;
    padding: 20px;
}

.deploy-result-box h3 {
    color: #2E7D32;
    margin-top: 0;
    margin-bottom: 15px;
}

.deploy-result-box h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.deploy-info {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.deploy-info p {
    margin: 5px 0;
}

.resource-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.resource-table th, 
.resource-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.resource-table th {
    background: #f5f5f5;
    font-weight: bold;
    font-size: 13px;
}

.resource-table td {
    font-size: 13px;
}

.next-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.delete-infra-btn {
    padding: 10px 20px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.delete-infra-btn:hover {
    background: #d32f2f;
}

.delete-infra-btn:disabled {
    background: #ef9a9a;
    cursor: not-allowed;
}

.permission-btn {
    padding: 10px 20px;
    background: #FF9800;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.permission-btn:hover {
    background: #F57C00;
}

.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: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
    color: #555;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a90d9;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.cancel-btn {
    padding: 10px 20px;
    background: #9e9e9e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.cancel-btn:hover {
    background: #757575;
}

.confirm-btn {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.confirm-btn:hover {
    background: #43a047;
}

::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* ===== 로그인 페이지 ===== */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

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

.login-logo {
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 24px;
    color: #333;
    margin: 0 0 8px 0;
}

.login-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.login-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: #0078D4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.login-form input::placeholder {
    color: #aaa;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: #0078D4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.login-btn:hover {
    background: #106ebe;
}

.login-btn:active {
    transform: scale(0.98);
}

.login-footer {
    margin-top: 30px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: #888;
    margin: 5px 0;
}

.login-hint {
    color: #0078D4 !important;
}
