/* Common styles for Casas com Essência application */

:root {
    --primary-color: #334155;
    --secondary-color: #323436;
    --background-color: #F8FAFC;
    --card-background: #FFFFFF;
    --text-color: #1E293B;
    --border-color: #E2E8F0;
    --danger-color: #DC2626;
    --success-color: #16A34A;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 40px auto;
    padding: 0 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-weight: 300;
    font-size: 2.5em;
    color: var(--primary-color);
}

/* Navigation Tabs */
.tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.tab-link {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    color: var(--secondary-color);
    font-size: 1.1em;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.tab-link.active,
.tab-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #1e293b;
}

.btn-secondary {
    padding: 12px 24px;
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.btn-secondary:hover {
    background-color: var(--background-color);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-weight: 600;
    font-size: 1.5em;
}

.close-button {
    font-size: 1.8em;
    cursor: pointer;
    color: var(--secondary-color);
    border: none;
    background: none;
}

.close-button:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background-color: #F8FAFC;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background-color: #F8FAFC;
    font-family: 'Poppins', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* Error Message */
.error-message {
    background-color: #fee;
    color: var(--danger-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--danger-color);
}

.success-message {
    background-color: #efe;
    color: var(--success-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--success-color);
}
