/* Terminal Popup Frontend Styles - Improved Version */
#terminal-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;  /* Start hidden */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#terminal-popup-overlay.show {
    display: flex;
    opacity: 1;
}

#terminal-popup-container {
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    font-family: 'JetBrains Mono', 'Fira Code', 'Menlo', 'Monaco', 'Courier New', monospace;
    transform: translateY(0);
    transition: transform 0.3s ease-out;
    animation: terminalEnter 0.4s ease-out;
}

@keyframes terminalEnter {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, #383838, #2a2a2a);
    padding: 10px 15px;
    border-radius: 10px 10px 0 0;
    position: relative;
}

.terminal-icon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    filter: invert(1);
}

.window-buttons {
    display: flex;
    z-index: 10;
    margin-right: 10px;
}

.close-button,
.minimize-button,
.maximize-button {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-button {
    background-color: #ff5f57;
    color: #700;
    font-size: 10px;
    line-height: 10px;
}

.close-button:hover {
    background-color: #ff3b30;
    transform: scale(1.1);
}

.minimize-button {
    background-color: #ffbd2e;
}

.minimize-button:hover {
    background-color: #ffcc00;
    transform: scale(1.1);
}

.maximize-button {
    background-color: #28c940;
}

.maximize-button:hover {
    background-color: #28cd41;
    transform: scale(1.1);
}

.terminal-title {
    position: absolute;
    width: 100%;
    text-align: center;
    left: 0;
    color: #f8f8f8;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
}

.terminal-content {
    background-color: rgba(22, 22, 22, 0.95);
    color: #f8f8f8;
    padding: 25px;
    min-height: 200px;
}

.terminal-prompt {
    margin-bottom: 20px;
    line-height: 1.5;
}

.typing-text {
    display: block;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    color: #f8f8f8;
}

.typing-container {
    margin-bottom: 20px;
}

.typing-text > div,
.typing-content,
.typing-container > div,
.typing-line > span {
    border-right: none !important;
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: #76e42e;
    vertical-align: middle;
    margin-left: 2px;
    animation: blink-caret 0.75s step-end infinite;
    box-shadow: 0 0 5px rgba(118, 228, 46, 0.5);
}

@keyframes blink-caret {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

.connecting-indicator {
    color: #76e42e;
    margin-bottom: 10px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.terminal-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #76e42e;
    margin-bottom: 8px;
    font-size: 0.9em;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="tel"] {
    background-color: rgba(40, 40, 40, 0.8);
    border: 1px solid #444;
    color: #f8f8f8;
    padding: 12px 15px;
    font-family: inherit;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="tel"]:focus {
    background-color: rgba(50, 50, 50, 0.8);
    border-color: #76e42e;
    box-shadow: 0 0 0 2px rgba(118, 228, 46, 0.2);
    outline: none;
}

.consent-group {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.consent-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background-color: rgba(40, 40, 40, 0.8);
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.consent-group input[type="checkbox"]:checked {
    background-color: #76e42e;
    border-color: #76e42e;
}

.consent-group input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 12px;
    font-weight: bold;
}

.consent-group label {
    margin-bottom: 0;
    color: #ddd;
    font-size: 0.9em;
}

#terminal-popup-submit {
    background-color: rgba(118, 228, 46, 0.1);
    color: #76e42e;
    border: 1px solid #76e42e;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    text-align: center;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-weight: 500;
}

#terminal-popup-submit:hover {
    background-color: rgba(118, 228, 46, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 228, 46, 0.2);
}

#terminal-popup-submit:active {
    transform: translateY(0);
}

#terminal-popup-message {
    color: #76e42e;
    margin-top: 20px;
    padding: 12px 15px;
    border-radius: 6px;
    background-color: rgba(118, 228, 46, 0.05);
    border-left: 3px solid #76e42e;
}

#terminal-popup-message.error {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.05);
    border-left: 3px solid #ff6b6b;
}

@media (max-width: 600px) {
    #terminal-popup-container {
        width: 95%;
        max-width: none;
    }
    
    .terminal-content {
        padding: 20px 15px;
    }
    
    .terminal-header {
        padding: 8px 12px;
    }
    
    .typing-text {
        font-size: 0.9em;
    }
    
    #terminal-popup-submit {
        padding: 12px 15px;
        width: 100%;
    }
}