/* CalliMotion Tool Styles */

/* Project Management Styles */
.project-controls {
    margin: 15px 0;
}

.project-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.project-list {
    max-height: 300px;
    overflow-y: auto;
}

.project-item {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.project-item:hover {
    background-color: #f8f9fa;
}

.current-project-info {
    margin-top: 5px;
    font-size: 0.9em;
    color: #6c757d;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
    margin-top: 15px;
}

.close {
    cursor: pointer;
    font-size: 20px;
}

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Aref+Ruqaa:wght@400;700&display=swap');

/* Font face declarations for local fonts */
@font-face {
    font-family: 'Amiri';
    src: url('/uac_website_tools/static/src/fonts/Amiri-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Amiri';
    src: url('/uac_website_tools/static/src/fonts/Amiri-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* Main container */
#callimotion-embed {
    background: none;
    width: 100%;
    min-height: 500px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

#callimotion-embed * {
    box-sizing: border-box;
}

/* Container - Light Mode */
#callimotion-embed .container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    color: #212529;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block !important;
    min-height: 400px;
}

/* Headers */
#callimotion-embed h2 {
    text-align: center;
    color: #000;
    margin-bottom: 40px;
}

#callimotion-embed h3 {
    text-align: left;
    color: #000;
    margin-bottom: 10px;
}

/* Input Groups */
#callimotion-embed .input-group {
    flex: 1;
    display: block;
    min-width: 90px;
}

#callimotion-embed .input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
    text-align: left;
}

#callimotion-embed .input-group input,
#callimotion-embed .input-group textarea {
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.3s;
    background-color: #f9fafe;
    color: #000;
    box-sizing: border-box;
}

#callimotion-embed .input-group input:focus,
#callimotion-embed .input-group textarea:focus {
    border-color: #3498db;
    outline: none;
}

/* Input Rows */
#callimotion-embed .input-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 10px;
    flex-wrap: wrap;
}

#callimotion-embed .input-group.small-input {
    flex: 0.1 0.2 4%;
}

#callimotion-embed .input-group.large-input {
    flex: 1.0 0 19%;
}

#callimotion-embed input[type="number"].small {
    width: 100%;
    height: 40px;
    padding: 1px;
    text-align: center;
}

/* Stroke Groups */
#callimotion-embed .stroke-group {
    display: block;
    max-width: 1300px;
    border: 1px solid #bdc3c7;
    border-radius: 8px;
    padding: 40px;
    background-color: #f9fafe;
    box-sizing: border-box;
    margin: 20px auto;
    width: 100%;
}

/* Textarea specific styling */
#callimotion-embed textarea {
    width: 100%;
    height: 120px;
    font-family: monospace;
    font-size: 14px;
    padding: 10px;
    border: 1px solid #34495e;
    text-align: left;
    border-radius: 4px;
    background-color: #f9fafe;
    color: #000;
    resize: vertical;
}

/* Number inputs */
#callimotion-embed input[type="number"] {
    width: 100%;
    font-family: monospace;
    font-size: 14px;
    padding: 10px;
    border: 1px solid #34495e;
    border-radius: 4px;
    background-color: #f9fafe;
    color: #000;
    text-align: center;
    resize: vertical;
}

/* Button Groups */
#callimotion-embed .button-group {
    padding: 20px 5px;
    border: none;
    border-radius: 5px;
    background-color: transparent;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

/* Grid Controls */
#callimotion-embed .grid-controls {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

#callimotion-embed .grid-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
    font-weight: 500;
}

#callimotion-embed .grid-controls input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
    cursor: pointer;
}

/* Buttons */
#callimotion-embed button {
    margin: 1px 1px 1px 1px;
    padding: 15px 20px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    background-color: #3498db;
    color: #fff;
    cursor: pointer;
}

#callimotion-embed button:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}

#callimotion-embed button:hover:not(:disabled) {
    background-color: #2980b9;
}

/* Specific Button Styles */
#callimotion-embed #exportButton {
    background-color: #3498db;
}

#callimotion-embed #exportButton:hover:not(:disabled) {
    background-color: #2980b9;
}

#callimotion-embed #importButton {
    background-color: #3498db;
}

#callimotion-embed #importButton:hover:not(:disabled) {
    background-color: #2980b9;
}

/* SVG Canvas */
#callimotion-embed svg {
    display: block;
    max-width: 1300px;
    background-color: #fff;
    border: 1px solid #bdc3c7;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Grid Styling */
#callimotion-embed .callimotion-grid-line {
    stroke: #e0e0e0;
    stroke-width: 1;
}

#callimotion-embed .callimotion-axis-line {
    stroke: #c0c0c0;
    stroke-width: 2;
}

#callimotion-embed .callimotion-axis-label {
    fill: #666;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

#callimotion-embed .cloned-stroke {
    fill: none;
    stroke: black;
    stroke-width: 3;
    opacity: 1.0;
}

#callimotion-embed .pen-stroke {
    fill: none;
    stroke: red;
    stroke-width: 3;
}

/* SVG Code Container */
#callimotion-embed #svgCodeContainer {
    margin-top: 40px;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    background-color: #fff;
}

#callimotion-embed #svgCode {
    width: 100%;
    height: 300px;
    font-family: monospace;
    font-size: 14px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f5f5f5;
    color: #000;
    resize: vertical;
    box-sizing: border-box;
}

#callimotion-embed .code-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#callimotion-embed #copyButton {
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    background-color: #39987e;
    color: #fff;
    cursor: pointer;
    margin-bottom: 20px;
    margin-top: 20px;
}

#callimotion-embed #copyButton:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}

#callimotion-embed #copyButton:hover:not(:disabled) {
    background-color: #236b57;
}

/* Modal Styles */
#callimotion-embed #resetModal.custom-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

#callimotion-embed #resetModal .custom-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    width: 300px;
    text-align: center;
    color: black;
}

#callimotion-embed #resetModal .custom-modal-btn {
    margin: 10px;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

#callimotion-embed #resetModal .custom-modal-btn:hover {
    background-color: #2980b9;
}

#callimotion-embed #resetModal .custom-modal-btn:focus {
    outline: none;
}

#callimotion-embed #resetModal .custom-modal-yes-btn {
    margin: 10px;
    padding: 10px 20px;
    background-color: #be4b27;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

#callimotion-embed #resetModal .custom-modal-yes-btn:hover {
    background-color: #9b3515;
}

#callimotion-embed #resetModal .custom-modal-yes-btn:focus {
    outline: none;
}

/* Form Container Animations */
#callimotion-embed .form-container {
    display: none !important;
    animation: fadeIn 0.5s ease-in-out;
    position: relative;
}

#callimotion-embed .form-container.active {
    display: block !important;
}

/* Force visibility for debugging */
#callimotion-embed #container-1 {
    display: block !important;
}

#callimotion-embed .remove-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #e74c3c;
    border: none;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

#callimotion-embed button.remove-btn:hover {
    background-color: #c0392b;
}

#callimotion-embed #add-more-btn {
    font-size: 16px;
    color: #fff;
    background-color: #1fb056;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#callimotion-embed #add-more-btn:hover:not(:disabled) {
    background-color: #188441;
}

#callimotion-embed #add-more-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Toast Notifications */
#callimotion-embed #toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #009688;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 30px;
    font-size: 17px;
    transform: translateX(-50%);
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    transition: opacity 1s ease, top 1s ease;
}

#callimotion-embed #toast.show {
    visibility: visible;
    opacity: 1;
    top: 80px;
}

/* Toast Types */
#callimotion-embed #toast.success {
    background-color: #28a745;
}

#callimotion-embed #toast.info {
    background-color: #17a2b8;
}

#callimotion-embed #toast.error {
    background-color: #dc3545;
}

#callimotion-embed #toast.warning {
    background-color: #ffc107;
    color: #000;
}

#callimotion-embed #toast .stroke-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#callimotion-embed #toast .stroke-header h3 {
    margin: 0;
}

#callimotion-embed #toast .stroke-header .allowable-strokes {
    font-size: 14px;
    color: #555;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    #callimotion-embed .input-row {
        flex-direction: column;
    }

    #callimotion-embed .remove-btn {
        top: 10px;
        right: 10px;
        padding: 5px 8px;
        font-size: 10px;
    }
}

/* Light mode explicit support */
@media (prefers-color-scheme: light) {
    #callimotion-embed .container {
        color: #000 !important;
        background: #fff !important;
        border: 1px solid #e9ecef !important;
    }

    #callimotion-embed .stroke-group {
        background: #fff !important;
        border-color: #e9ecef !important;
    }

    #callimotion-embed label,
    #callimotion-embed .input-group label,
    #callimotion-embed h2,
    #callimotion-embed h3 {
        color: #000 !important;
        font-weight: 600 !important;
    }

    #callimotion-embed input,
    #callimotion-embed select,
    #callimotion-embed textarea {
        background: #fff !important;
        border-color: #e9ecef !important;
        color: #000 !important;
    }
}



/* Default fallback colors */
#callimotion-embed {
    color: #000;
}

#callimotion-embed label,
#callimotion-embed .input-group label,
#callimotion-embed h2,
#callimotion-embed h3 {
    color: #000 !important;
    font-weight: 600;
}

#callimotion-embed input,
#callimotion-embed select,
#callimotion-embed textarea {
    color: #000 !important;
    background: #fff;
    border: 1px solid #e9ecef;
}

/* Login Message Styles */
#callimotion-embed .login-message,
.s_callimotion .login-message {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#callimotion-embed .login-message:hover,
.s_callimotion .login-message:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

#callimotion-embed .login-message .fa-user-circle,
.s_callimotion .login-message .fa-user-circle {
    color: #007bff;
    filter: drop-shadow(0 2px 4px rgba(0, 123, 255, 0.3));
}

#callimotion-embed .login-message h5,
.s_callimotion .login-message h5 {
    font-weight: 600;
    margin-bottom: 8px;
}

#callimotion-embed .login-message .btn,
.s_callimotion .login-message .btn {
    transition: all 0.2s ease;
    font-weight: 500;
}

#callimotion-embed .login-message .btn:hover,
.s_callimotion .login-message .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#callimotion-embed .login-message .btn-primary,
.s_callimotion .login-message .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
}

#callimotion-embed .login-message .btn-outline-primary,
.s_callimotion .login-message .btn-outline-primary,
#callimotion-embed .login-message .btn-outline-primary:link,
.s_callimotion .login-message .btn-outline-primary:link,
#callimotion-embed .login-message .btn-outline-primary:visited,
.s_callimotion .login-message .btn-outline-primary:visited {
    border: 2px solid #007bff !important;
    color: #007bff !important;
    background: transparent !important;
    text-decoration: none !important;
}

#callimotion-embed .login-message .btn-outline-primary:hover,
.s_callimotion .login-message .btn-outline-primary:hover,
#callimotion-embed .login-message .btn-outline-primary:focus,
.s_callimotion .login-message .btn-outline-primary:focus,
#callimotion-embed .login-message .btn-outline-primary:active,
.s_callimotion .login-message .btn-outline-primary:active {
    background: #007bff !important;
    color: white !important;
    border-color: #007bff !important;
    text-decoration: none !important;
}

#callimotion-embed .login-message small,
.s_callimotion .login-message small {
    font-size: 0.85em;
    opacity: 0.8;
}
