/**
 * Engineered Solutions Authentication System Styles
 */

/* Modal Styles */
.esa-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.esa-modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.esa-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.esa-modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.esa-close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.esa-close:hover {
    color: #000;
}

.esa-modal-body {
    padding: 20px;
}

/* Tab Styles */
.esa-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.esa-tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.esa-tab-btn.active {
    color: #007cba;
    border-bottom-color: #007cba;
}

.esa-tab-btn:hover {
    color: #007cba;
}

.esa-tab-content {
    display: none;
}

.esa-tab-content.active {
    display: block;
}

/* Form Styles */
.esa-form-group {
    margin-bottom: 15px;
}

.esa-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.esa-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.esa-form-group input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Button Styles */
.esa-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    text-align: center;
}

.esa-btn-primary {
    background-color: #007cba;
    color: white;
    width: 100%;
}

.esa-btn-primary:hover {
    background-color: #005a87;
}

.esa-btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.esa-btn-google {
    background-color: #db4437;
    color: white;
    margin: 5px;
    width: calc(50% - 10px);
}

.esa-btn-google:hover {
    background-color: #c23321;
}

.esa-btn-facebook {
    background-color: #3b5998;
    color: white;
    margin: 5px;
    width: calc(50% - 10px);
}

.esa-btn-facebook:hover {
    background-color: #2d4373;
}

/* Social Login Styles */
.esa-social-login {
    margin-top: 20px;
    text-align: center;
}

.esa-social-login p {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.esa-social-login .esa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* User Bar Styles */
.esa-user-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #007cba;
    color: white;
    padding: 10px 20px;
    z-index: 9999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.esa-user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.esa-user-info span {
    font-weight: 500;
}

/* Message Styles */
.esa-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 10001;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.esa-message-success {
    background-color: #28a745;
}

.esa-message-error {
    background-color: #dc3545;
}

.esa-message-info {
    background-color: #17a2b8;
}

/* Chart Access Control Styles */
.esa-guest-chart {
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: #6c757d;
}

.esa-guest-chart h3 {
    color: #495057;
    margin-bottom: 10px;
}

.esa-guest-chart p {
    margin-bottom: 5px;
}

/* Button Override Styles for Guest Users */
.esa-guest-button {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.esa-guest-button::after {
    content: "Login Required";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.esa-guest-button:hover::after {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .esa-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .esa-modal-header {
        padding: 15px;
    }
    
    .esa-modal-body {
        padding: 15px;
    }
    
    .esa-social-login .esa-btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .esa-user-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .esa-message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Animation Styles */
.esa-modal {
    animation: fadeIn 0.3s ease;
}

.esa-modal-content {
    animation: slideIn 0.3s ease;
}

.esa-message {
    animation: slideInRight 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from { 
        opacity: 0;
        transform: translateX(100%);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading States */
.esa-loading {
    position: relative;
    pointer-events: none;
}

.esa-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
