/* DigitalSketch.ai - Main Stylesheet with Bootstrap */

/* Base Styles - Override Bootstrap where needed */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* Gradient Background for Login/Signup Pages */
.gradient-background {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #1a229d 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Auth Container */
.auth-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 35px 50px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.auth-container h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.auth-container .subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.auth-container .subtitle a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-container .subtitle a:hover {
    text-decoration: underline;
}

/* Form Styles */
.form-group {
    margin-bottom: 14px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;    
    padding: 12px;
    font-size: 16px;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #666;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group .btn {
    flex: 1;
}

/* Links */
.forgot-password {
    display: block;
    text-align: right;
    margin-top: -8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.footer-links {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #999;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Alert Messages - Bootstrap compatible */
.alert {
    border-radius: 6px;
    font-size: 14px;
}

/* Custom alert for error type (maps to Bootstrap danger) */
.alert-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
}

/* Left Navigation Bar */
.left-nav {
    width: 50px;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.left-nav .logo {
    width: 28px;
    height: 28px;
    margin-bottom: 28px;
    border-radius: 4px;
}

.nav-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 0 8px;
}

.nav-item {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #8892b0;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-size: 16px;
}

.nav-item:hover {
    background: #2d2d44;
    color: #64ffda;
}

.nav-item.active {
    background: #667eea;
    color: white;
}

.nav-item .tooltip {
    position: absolute;
    left: 60px;
    background: #2d2d44;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav-item:hover .tooltip {
    opacity: 1;
}

.nav-bottom {
    margin-top: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.nav-bottom-btn {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #8892b0;
    border: 1px solid #3d3d54 !important;
    background: transparent !important;
    transition: all 0.3s ease;
    font-size: 16px;
}

.nav-bottom-btn:hover {
    background: #2d2d44 !important;
    color: #64ffda;
    border-color: #64ffda !important;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.user-avatar:hover {
    transform: scale(1.1);
    background: #5568d3;
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: absolute;
    bottom: auto;
    top: -180px;
    left: 60px;
    min-width: 160px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
}

.user-menu-dropdown .dropdown-item {
    padding: 8px 12px;
    font-size: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.user-menu-dropdown .dropdown-item:hover {
    background: #f5f5f5;
    color: #667eea;
}

.user-menu-dropdown .dropdown-item i {
    font-size: 12px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 50px;
    padding: 15px;
    overflow-y: auto;
    height: 100vh;
}

.content-header {
    margin-bottom: 5px;
}

.content-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.content-header-top > div:first-child {
    flex: 1;
}

.content-header-top button {
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.content-header p {
    color: #666;
    font-size: 14px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a1a;
}

/* Timezone Modal Styles */
.timezone-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
}

.timezone-modal-backdrop.show {
    display: block;
}

.timezone-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1101;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    flex-direction: column;
}

.timezone-modal.show {
    display: flex;
}

.timezone-modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.timezone-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}

.timezone-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timezone-modal-close:hover {
    color: #1f2937;
}

.timezone-modal-body {
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.timezone-search-container {
    margin-bottom: 1rem;
}

.timezone-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.timezone-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.timezone-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timezone-item {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.timezone-item:hover {
    background-color: #f9fafb;
    border-color: #667eea;
}

.timezone-item.selected {
    background-color: #dbeafe;
    border-color: #0369a1;
    font-weight: 600;
    color: #0369a1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timezone-item-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1f2937;
    flex: 1;
}

.timezone-item.selected .timezone-item-label {
    color: #0369a1;
    font-weight: 600;
}

.timezone-item-checkmark {
    display: none;
    color: #0369a1;
    font-size: 1.1rem;
    margin-left: 0.5rem;
}

.timezone-item.selected .timezone-item-checkmark {
    display: inline-block;
}

.timezone-item-offset {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.timezone-modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-shrink: 0;
}

.timezone-modal-footer .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 30px 25px;
    }

    .left-nav {
        width: 50px;
    }

    .main-content {
        margin-left: 50px;
        padding: 20px;
    }

    .user-menu-dropdown {
        left: 60px;
    }

    .timezone-modal {
        width: 95%;
        max-width: 500px;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Hierarchy Item Text Wrapping */
.hierarchy-item span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
    line-height: 1.4;
    white-space: normal;
}

/* Confirmation Modal - Hide images list by default */
.confirm-images-list {
    display: none;
}

.confirm-images-list.show {
    display: block;
}

/* P&ID Images List Container */
#pidImagesList {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Table responsive wrapper */
.table-responsive-custom {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
}

/* Pagination controls stay at bottom */
.pagination-controls {
    flex-shrink: 0;
}


/* Google Translate Modal Styles */
.translate-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
}

.translate-modal-backdrop.show {
    display: block;
}

.translate-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1101;
    width: 90%;
    max-width: 400px;
    flex-direction: column;
}

.translate-modal.show {
    display: flex;
}

.translate-modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.translate-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}

.translate-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.translate-modal-close:hover {
    color: #1f2937;
}

.translate-modal-body {
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.translate-modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-shrink: 0;
}

.translate-modal-footer .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    white-space: nowrap;
}

/* Google Translate Element Styling */
#google_translate_element {
    display: flex;
    justify-content: center;
}

#google_translate_element .goog-te-gadget {
    font-family: Arial, sans-serif;
}

#google_translate_element .goog-te-gadget-simple {
    background-color: transparent;
    border: none;
    padding: 0;
}

#google_translate_element .goog-te-gadget-simple .goog-te-combo {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    cursor: pointer;
}

#google_translate_element .goog-te-gadget-simple .goog-te-combo:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Hide Google Translate banner frame completely */
.goog-te-banner-frame {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Hide skiptranslate div but keep it in DOM for Google Translate to work */
.skiptranslate {
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

/* Prevent page from shifting down */
body {
    top: 0px !important;
}

/* Hide default Google Translate dropdown icon */
.goog-logo-link,
.goog-te-gadget-icon {
    display: none !important;
}

/* Optional: Hide the "Powered by Google" text */
.goog-te-gadget span {
    display: none !important;
}

/* Keep google_translate_element off-screen but functional */
#google_translate_element {
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Custom language dropdown styling */
#languageDropdown {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    cursor: pointer;
}

#languageDropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#languageDropdown:hover {
    background-color: #f9fafb;
}

@media (max-width: 600px) {
    .translate-modal {
        width: 95%;
        max-width: 350px;
    }
}

/* Settings Page Styles */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.settings-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.settings-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section h3 i {
    color: #667eea;
    font-size: 20px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings-display {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.setting-label {
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.setting-value-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.setting-value {
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 500;
    flex: 1;
    word-break: break-word;
}

.edit-btn {
    padding: 4px 8px;
    color: #667eea;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.edit-btn:hover {
    color: #5568d3;
    background-color: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
}

.edit-btn i {
    font-size: 16px;
}

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

.settings-form .form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.settings-form .form-control {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.settings-form .form-control:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-form .form-control:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.settings-form .form-text {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    justify-content: flex-start;
}

.settings-actions .btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-actions .btn-primary {
    background: #667eea;
    color: white;
    border: none;
}

.settings-actions .btn-primary:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.settings-actions .btn-secondary {
    background: #e0e0e0;
    color: #333;
    border: none;
}

.settings-actions .btn-secondary:hover {
    background: #d0d0d0;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .settings-container {
        padding: 15px;
    }

    .settings-section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions .btn {
        width: 100%;
        justify-content: center;
    }
}



