/* style.css */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --success-color: #28a745;
    --error-color: #dc3545;
    --info-color: #17a2b8;
}

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

body {
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.anycoder-link {
    display: block;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.anycoder-link:hover {
    color: white;
}

main {
    max-width: 800px;
    margin: 0 auto;
}

section {
    background: var(--card-bg);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

h2 {
    color: var(--primary-color);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Botões */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    margin-right: 10px;
    margin-bottom: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.1s;
}

button:disabled {
    background-color: var(--secondary-color);
    color: #aaa;
    cursor: not-allowed;
}

#save-location-btn, #retrieve-location-btn {
    background-color: var(--primary-color);
    color: white;
}

#save-location-btn:not(:disabled):hover, #retrieve-location-btn:not(:disabled):hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/* Botão de Login */
#login-btn {
    background-color: #db4437;
    color: white;
    width: 100%;
    max-width: 300px;
    padding: 12px;
    font-size: 1.1em;
}

#login-btn img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    background: white;
    border-radius: 50%;
    padding: 2px;
}

#login-btn:hover:not(:disabled) {
    background-color: #c73d30;
}

.status-info {
    margin-top: 10px;
    font-style: italic;
    color: var(--secondary-color);
}

/* Ações */
#actions-section {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.icon {
    margin-right: 8px;
}

/* Mapa Simulado */
#map-container {
    background: #e9ecef;
    border: 1px solid #ccc;
    padding: 20px;
    min-height: 150px;
    border-radius: 5px;
    text-align: center;
}

/* Histórico */
#history-list {
    list-style: none;
    padding: 0;
}

#history-list li {
    border-bottom: 1px dashed #ddd;
    padding: 8px 0;
    font-size: 0.9em;
}

#history-list li:last-child {
    border-bottom: none;
}

/* IA Demo */
#ai-input {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
}

#run-ai-btn {
    background-color: #ffc107;
    color: var(--text-color);
}

#run-ai-btn:hover:not(:disabled) {
    background-color: #e0a800;
}

#ai-output-container {
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f4f4f4;
}


/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s;
}

.hidden {
    display: none !important;
}

.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

#loading-text {
    color: white;
    font-weight: bold;
}

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

/* Message Box */
.message-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.message-box.success {
    background-color: var(--success-color);
}

.message-box.error {
    background-color: var(--error-color);
}

.message-box.info {
    background-color: var(--secondary-color);
}

/* Responsividade */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    header {
        padding: 15px 10px;
    }
    h1 {
        font-size: 1.3em;
    }
    h2 {
        font-size: 1.2em;
    }
    
    #actions-section {
        flex-direction: column;
    }
    
    button, #login-btn {
        width: 100%;
        margin-right: 0;
        font-size: 1em;
    }
}