/**************************************************
 * CULDESA WORK TOOLS - CORE STYLES
 * 
 * This file contains:
 * - Core Variables
 * - Base Styles & Reset
 * - Layout Components
 * - Authentication & User Management
 * - Project Management
 **************************************************/

/**************************************************
 * 1. CORE VARIABLES
 **************************************************/
:root {
    --white: #FFFFFF;
    --black: #000000;
    --red: #FF0000;
    --green-light: #84c0e8;
    --green-teal: #34495e;
    --beige-light: #FBF8F4;
    
    /* Additional utility colors */
    --gray-light: #557595;
    --gray-medium: #9e9e9e;
    --primary: #34495e;  
    --secondary: #84c0e8;  
}

/**************************************************
 * 2. BASE STYLES & RESET
 **************************************************/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /*! text-align: center; */
}

body {
    font-family: monospace;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px; /* Base font size */
    line-height: 1.5;
    color: var(--black);
    background-color: var(--white);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

h4{
    font-size: 14px;
    color: var(--gray-medium);
}
button {
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
}

input, select, textarea {
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
}

/* Placeholder styling */
[contenteditable="true"]:empty::before {
  content: attr(placeholder);
  color: #ccc;
  font-style: italic;
  font-size: 14px;
}

::placeholder {
  color: #ccc !important;
  font-style: italic !important;
}

input::placeholder, 
textarea::placeholder {
  color: #ccc;
  font-style: italic;
}

/**************************************************
 * 3. LAYOUT COMPONENTS 
 **************************************************/

/* Main App Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--primary);
    color: var(--white);
}

.header-left h1 {
    font-size: 20px;
    margin-right: 20px;
}

#current-project-name {
    font-size: 16px;
    font-weight: 500;
}

.header-right {
    /* display: flex; */
    /* align-items: center; */
    /* gap: 15px; */
}

.header-right button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    background-color: var(--secondary);
    color: var(--white);
}

/* Tab Navigation */
.tab-container {
    margin: 20px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-light);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-weight: 500;
    color: var(--gray-medium);
    border-bottom: 3px solid transparent;
    cursor: pointer;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.module-container {
    display: none;
    background-color: var(--white);
    border-radius: 8px;
    /*box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);*/
    padding: 20px;
    /*! width: 1200px; */
}

.module-container.active {
    display: block;
}

/* Compact Header Styles */
.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--primary);
    color: var(--white);
    height: 48px; /* Fixed small height */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-container {
    /* display: flex; */
    /* align-items: center; */
}

.logo-container h1 {
    font-size: 16px;
    margin: 0;
    font-weight: 600;
}

.project-indicator {
    display: flex;
    align-items: center;
    margin-left: 16px;
    font-size: 14px;
    background-color: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 4px;
}

.project-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    background-color: var(--secondary);
    border-radius: 50%;
}

.user-info {
    font-size: 13px;
    padding: 4px 8px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.header-actions {
    display: flex;
    gap: 6px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.icon-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Icon classes */
.back-icon:before {
    content: "â†";
}

.logout-icon:before {
    content: "â»";
}

/* Module save controls */
.module-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    gap: 10px;
}

.module-controls button {
    padding: 3px 2px;
    border: none;
    border-radius: 6px;
    background-color: var(--green-teal);
    color: var(--beige-light);
    /* height: 100%; */
    width: 12%;
}

/**************************************************
 * 4. AUTHENTICATION & USER MANAGEMENT 
 **************************************************/

/* Login Screen Styles */
#login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background-color: var(--white);
  padding: 32px;
  border-radius: 9px;
  box-shadow: -5px 4px 12px rgba(0, 7, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 100%;
  color: var(--green-teal);
}

.auth-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: none;
    border-radius: 4px;
    background-color: var(--primary);
    color: var(--white);
    font-weight: 500;
    transition: background-color 0.3s;
}

.auth-btn:hover {
    background-color: var(--green-light);
}

.logout {
    background-color: var(--red);
}

.logout:hover {
    background-color: #d32f2f;
}

/* Viewer mode styles */
.viewer-mode-notice {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border-left: 4px solid #2e7d32;
    font-weight: 500;
}

/* Style for input elements in viewer mode */
input.viewer-mode,
textarea.viewer-mode,
select.viewer-mode {
    background-color: #f5f5f5;
    border-color: #ddd;
    cursor: not-allowed;
    color: #666;
}

/* Style for contenteditable elements in viewer mode */
[contenteditable].viewer-mode {
    background-color: #f5f5f5;
    border-color: #ddd;
    cursor: not-allowed;
    outline: none;
}

/*/* Ensure load buttons are visible and styled differently */
/*[id^="load-"] {
    background-color: #64b5f6;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}*/
//*
[id^="load-"]:hover {
    background-color: #42a5f5;
}
*/
/* Custom styles for select dropdown in viewer-mode */
select.viewer-mode {
    appearance: none;  /* Remove default arrow */
    -webkit-appearance: none;
    padding-right: 25px;  /* Space for custom arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23999' d='M0 0l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* User management panel */
.project-management-panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.project-management-panel h2 {
    background-color: var(--green-teal);
    color: #fff;
    margin: 0;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 500;
}

.project-management-panel h3 {
    color: #333;
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.project-management-content {
    padding: 20px;
}

.create-project-section,
.project-list-section,
.project-members-section,
.assigned-projects-section {
    margin-bottom: 30px;
}

.add-member-um {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.add-member-um input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.add-member-um select {
    width: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.back-to-projects {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    cursor: pointer;
}

.back-to-projects:hover {
    background-color: #e9ecef;
}

.no-projects {
    color: #6c757d;
    font-style: italic;
}

/**************************************************
 * 5. PROJECT MANAGEMENT
 **************************************************/

/* Project Screen Styles */
#project-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.project-container {
    background-color: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
}

.project-actions {
    display: flex;
    /* margin: 20px 0; */
    /* gap: 10px; */
    flex-direction: row;
    align-items: center;
}

.project-actions input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
}

.project-actions button {
       background: none;
    color: #84c0e8;
    /* border: 1px solid #3498db; */
    /* padding: 5px 10px; */
    /* border-radius: 3px; */
    cursor: pointer;
    font-size: 14px;
    width: 20px;
    margin: 0px;
    transition: all 0.2s ease;
    text-align: center;

}

//* Clean Sidebar Implementation */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}
/**************************************************
 * LAYOUT FIX - SIDEBAR + MAIN CONTENT
 **************************************************/

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.sidebar {
    width: 250px; /* Fixed width */
    min-width: 250px; /* Prevent shrinking */
    height: 100vh;
    background-color: #34495e;
    color: white;
    overflow-y: auto;
    flex-shrink: 0; /* Don't shrink */
}

.main-content {
    flex: 1; /* Take remaining space */
    height: 100vh;
    overflow-y: auto;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
}

/* Ensure tab content takes full space */
.tab-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Module containers should be full width within tab-content */
.module-container {
    width: 100%;
    width: 1200px; /* Maximum width for large screens */
    margin: 0 auto; /* Center the content */
    background-color: #f5f7fa;
    border-radius: 8px;
    /*box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);*/
    padding: 20px;
}

.module-container.active {
    display: block;
}/**************************************************
 * SIDEBAR STYLES
 **************************************************/

.sidebar-section {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section-header h3 {
    color: #95a5a6;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0 0 10px 0;
    padding: 0 15px;
    letter-spacing: 1px;
}

.sidebar-section-content {
    padding: 0;

}

/* User profile styles */
.user-profile {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: block !important;
}

.user-avatar {
    width: 20px;
    height: 20px;
    background: #f8f9fa;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34495e;
    font-weight: bold;
    font-size: 16px;
}

.user-info h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: white;
}

.user-info p {
    margin: 0 0 10px 0;
    font-size: 11px;
    color: #bdc3c7;
}

.sidebar-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    margin-top: 5px;
    width: 100%;
}

.sidebar-btn:hover {
    background: #c0392b;
}

/* Project actions */
.sidebar-project-actions {
    padding: 10px 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 10px;
}

.sidebar-project-actions input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    color: #f8f9fa !important;
    font-size: 13px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.sidebar-project-actions input::placeholder {
    color: #95a5a6;
}

.sidebar-project-actions button {
    background: none;
    color: #3498db;
    border: 1px solid #3498db;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    transition: all 0.2s ease;
}

 
#sidebar-project-list {
    width: 200px;
    cursor: pointer;
    text-transform: capitalize;
    font-size: 11px;
    margin: 10px;
    /* padding: 5px; */
}

.sidebar-project-item {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    margin: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 100;
}

a#help-btn {
    color: beige;
    margin: 5px;
}
 

.sidebar-nav-item {
    margin: 10px;
    cursor: pointer;
    font-size: 11px;
    /* margin-left: 10px; */
    letter-spacing: 1.5px;
    /* color: color(srgb 0.2045 0.2851 0.3673); */
    text-transform: uppercase;
    font-weight: 100;
}

/* Help section at bottom of sidebar */
.sidebar-help-section {
    padding: 10px;
    text-align: left;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-help-link {
    color: #95a5a6;
    text-decoration: none;
    font-size: 12px;
    display: block;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.sidebar-help-link:hover {
    color: #3498db;
    background: rgba(255,255,255,0.05);
}

/* Adjust project actions since it's now separate */
.sidebar-project-actions {
    padding: 0 15px 10px 15px;
}

div#notification-badge {
    cursor: pointer;
    font-size: 11px;
    letter-spacing: 1px;
    color: #fff;
}

/* ADD THIS CSS TO YOUR core.css FILE */

/* Email Modal Styles */
.email-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.email-modal {
    background: white;
    border-radius: 8px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

.email-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.email-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: #f0f0f0;
    color: #333;
}

.email-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.subject-line {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.send-action {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #e7f3ff;
    border-radius: 8px;
    border: 2px solid #007bff;
}

.send-email-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.send-email-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-2px);
}

.send-email-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.action-description {
    margin: 10px 0 0 0;
    font-size: 14px;
    color: #666;
}

.email-preview-container {
    border: 2px solid #ddd;
    border-radius: 4px;
    margin: 15px 0;
    background: white;
}

.email-preview {
    padding: 20px;
    background: white;
    max-height: 400px;
    overflow-y: auto;
    font-family: Arial, sans-serif;
    
    /* Make content selectable and copyable */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.instructions-panel {
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    animation: slideDown 0.5s ease;
}

.instructions-panel h4 {
    margin: 0 0 15px 0;
    color: #155724;
    font-size: 18px;
    text-align: center;
}

.instruction-steps {
    margin-bottom: 15px;
}

.step {
    display: flex;
    align-items: center;
    margin: 12px 0;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.step-number {
    background: #28a745;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-text {
    font-size: 14px;
    line-height: 1.4;
}

.success-note {
    text-align: center;
    font-size: 14px;
    color: #155724;
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    .email-modal {
        width: 98%;
        max-height: 95vh;
    }
    
    .send-email-btn {
        width: 100%;
        min-width: auto;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .email-preview {
        padding: 10px;
        font-size: 12px;
        max-height: 300px;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .instructions-panel {
        padding: 15px;
    }
}

/* ADD THIS CSS TO YOUR core.css FILE */

/* Instructions Popup Overlay */
.instructions-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    animation: fadeIn 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Instructions Popup */
.instructions-popup {
    background: var(--white);
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s ease;
    overflow: hidden;
    border: 3px solid var(--primary);
}

.instructions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--primary);
    color: var(--white);
}

.instructions-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.close-popup {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    font-family: inherit;
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.3);
}

.instructions-content {
    padding: 25px;
    background: var(--white);
}

.instruction-steps {
    margin-bottom: 20px;
}

.step {
    display: flex;
    align-items: center;
    margin: 15px 0;
    padding: 12px;
    background: var(--beige-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    transition: transform 0.2s ease;
}

.step:hover {
    transform: translateX(5px);
    background: var(--secondary);
    background: rgba(132, 192, 232, 0.1);
}

.step-number {
    background: var(--primary);
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
    font-size: 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.step-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.success-note {
    text-align: center;
    font-size: 14px;
    color: var(--primary);
    background: var(--secondary);
    background: rgba(132, 192, 232, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--secondary);
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .instructions-popup {
        width: 95%;
        max-width: none;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .instructions-content {
        padding: 20px;
    }
    
    .instructions-header {
        padding: 15px;
    }
    
    .instructions-header h3 {
        font-size: 1.1em;
    }
}