.terminal-toggle {
    width: 124px;
    height: 41px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    user-select: none;
    margin: 5px 0px -2px -3px;
    padding: 0 0 0 9px !important;
    font-size: 15px;
    color: #FFF;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(162deg, #546878 0%, #393934 100%);
    /* background: #444444; */
    line-height: 31px;
    vertical-align: top;
}

.terminal-toggle:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #69727a 0%, #5a7081 100%);
}

.terminal-toggle:active {
    transform: scale(0.95);
}
.terminal-toggle span{float:left;margin: -1px 0px 0px -6px;width: 22px;height: 32px;font-size: 24px;}

.status-indicator {
    position: relative;
    top: -1px;
    right: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #dc3545;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: 2px solid white;
    float: right;
}

.terminal-container {
    width: 100%;
    height: 100%;
    /* background: rgb(0 0 0); */
    /* background: linear-gradient(135deg, #31404d 0%, #000000 100%); */
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 0px solid rgba(255, 255, 255, 0.1);
    margin: 0px 0px -100% 0px;
    display: none;
}

.terminal-container.active {
    display: flex;
}

.terminal-header {
    background: linear-gradient(135deg, #617686, #2f2f2b);
    padding: 12px 20px;
    border-radius: 0px 0px 0 0;
    display: block;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0px solid rgba(255, 255, 255, 0.1);
    display: none;
}

.terminal-title {
    color: #eeeeec;
    font-weight: 600;
    font-size: 14px;
}

.close-btn {
    background: #ff5f56;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s ease;
    float: right;
}

.close-btn:hover {
    background: #ff3b30;
}

.connection-bar {
    background: rgb(39 40 34);
    padding: 12px 20px 13px 20px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    /* border-bottom: 1px solid rgba(255, 255, 255, 0.1); */
    /* background: linear-gradient(135deg, #617686, #2f2f2b); */
}

.connection-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 10px;
    color: #eeeeec;
    font-size: 12px;
    transition: all 0.2s ease;
}

.connection-input:focus {
    outline: none;
    border-color: #607484;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgb(0 0 0 / 20%);
}

.connection-input::placeholder {
    color: rgba(238, 238, 236, 0.6);
}


#terminalContainer .btn {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    /* background: linear-gradient(1deg, #5b7183 0%, #49483e 100%); */
    float: left;
    background-color: #3d3e39;
    display: block;
}
#terminalContainer .btn .fas{font-size: 16px;font-weight:bold;}
#terminalContainer .btn:hover {
    /* background: linear-gradient(45deg, #009688, #eb9d32); */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #5a6268, #495057);
}

#terminalContainer .btn:active {
    transform: translateY(0);
}

.btn-secondary {
    /* background: linear-gradient(135deg, #6c757d, #5a6268); */
    background: #575757;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
}

.saved-connections {
    position: relative;
}

.saved-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgb(61 61 56);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-width: 250px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.saved-dropdown.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.saved-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.saved-item:hover {
    background: rgba(233, 84, 32, 0.2);
}

.saved-item.empty-state {
    cursor: default;
    color: rgba(238, 238, 236, 0.6);
    justify-content: center;
}

.saved-item.empty-state:hover {
    background: transparent;
}

.saved-info {
    flex-grow: 1;
}

.saved-name {
    color: #eeeeec;
    font-size: 12px;
    font-weight: 500;
}

.saved-timestamp {
    color: rgba(238, 238, 236, 0.7);
    font-size: 10px;
    margin-top: 2px;
}

.delete-saved {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.delete-saved:hover {
    background: rgba(220, 53, 69, 0.2);
    transform: scale(1.1);
}


.terminal-content {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

#terminal {
    height: 100%;
    width: 100%;
}

.saved-dropdown::-webkit-scrollbar {
    width: 6px;
}

.saved-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.saved-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.saved-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 1024px) {
    .terminal-container {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }
}

@media (max-width: 768px) {
    .terminal-container {
        top: 20px;
        height: calc(100vh - 40px);
        width: calc(100vw - 40px);
    }
    
    .connection-bar {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .connection-input {
        min-width: 80px;
        flex: 1;
    }
    
    .btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .terminal-toggle {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .terminal-container {
        top: 10px;
        right: 10px;
        left: 10px;
        height: calc(100vh - 20px);
    }
    
    .terminal-header {
        padding: 8px 15px;
    }
    
    .connection-bar {
        padding: 8px 15px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .connection-input {
        width: 100%;
        margin-bottom: 4px;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-indicator.connecting {
    animation: pulse 1s infinite;
}

.terminal-container.active #terminal {
    outline: none;
}

.xterm-viewport {
    background: transparent !important;
}

.xterm-rows {
    background: transparent !important;
}
.xterm {
    padding: 10px 20px 10px 20px;
}


.xterm .xterm-viewport{overflow-y: auto !important;}
