﻿ 
:root {
    --primary-color: #1471ce;
    --primary-hover: #105ba5;
    --success-color: #28a745;
    --success-hover: #218838;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #334155;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    background: var(--bg-color);
    margin: 0;
    color: var(--text-color);
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    margin-bottom: 15px;
}

    .back-link:hover {
        color: var(--primary-hover);
    }

/* --- Header Wrapper Design --- */
.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

    .header-wrapper h2 {
        margin: 0;
        font-size: 1.4rem;
        color: #1e293b;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-header {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: inherit;
}

.btn-header-link {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

    .btn-header-link:hover {
        background-color: #e2e8f0;
        color: #1e293b;
        border-color: #94a3b8;
    }

/* --- Excel Table Container Layout --- */
.excel-container {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    width: 100%;
    margin-bottom: 25px;
    overflow-x: auto; /* Tables ko wrapper ke andar scroll karega */
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

    .excel-container h2 {
        font-size: 1.2rem;
        color: #1e293b;
        margin-top: 0;
        margin-bottom: 15px;
    }

table {
    width: 100%;
    border-collapse: collapse;
    /* Data columns safe rakhne ke liye scroll capability wrapper me di hai */
}

th {
    background: var(--primary-color);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-size: 13px;
    border: 1px solid var(--primary-hover);
    white-space: nowrap;
}

td {
    padding: 10px 8px;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
}

input[type="text"], input[type="number"], input[type="time"], select, textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-color);
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    input:focus, select:focus, textarea:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(20, 113, 206, 0.15);
    }


textarea {
    resize: vertical;
    min-width: 160px;
}

/* Input type file styling fix */
input[type="file"] {
    font-size: 12px;
    max-width: 180px;
}

/* Buttons Grid & Row Styles */
.btn-add {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

    .btn-add:hover {
        background: var(--success-hover);
    }

.btn-remove {
    color: var(--danger-color);
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    font-size: 18px;
    transition: color 0.2s;
}

    .btn-remove:hover {
        color: var(--danger-hover);
    }

/* Disabled elements management styling code */
.task-row input:disabled,
.task-row select:disabled,
.task-row textarea:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- Footer Main Actions Grid --- */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    margin-bottom: 40px;
    width: 100%;
}

.btn-save, .btn-cancel {
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    font-family: inherit;
}

.btn-save {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(20, 113, 206, 0.15);
}

    .btn-save:hover {
        background-color: var(--primary-hover);
    }

.btn-cancel {
    background-color: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
}

    .btn-cancel:hover {
        background-color: #cbd5e1;
        color: #1e293b;
    }

/* ==========================================================================
           Media Queries for Perfect Mobile Adaption (Max-Width: 768px)
           ========================================================================== */
@media screen and (max-width: 768px) {
    body {
        padding: 12px;
    }

    .header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .btn-header {
        justify-content: center;
        padding: 10px;
        font-size: 12px;
    }

    .excel-container {
        padding: 12px;
        border-radius: 8px;
    }

    table {
        min-width: 1400px; /* Mobile par width optimization dynamic touch support ke liye */
    }

    .btn-add {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .form-actions {
        flex-direction: column-reverse; /* Mobile view logic reverse buttons layout pattern */
        gap: 10px;
    }

    .btn-save, .btn-cancel {
        width: 100%;
        padding: 14px;
        font-size: 15px;
    }

    .link-modal-actions {
        flex-direction: column-reverse;
    }

        .link-modal-actions button {
            width: 100%;
        }
}
 
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4); /* Dark translucent overlay */
    backdrop-filter: blur(4px); /* Smooth blur effect */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* Open state for Modal */
.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Box Design */
.modal-box {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-sizing: border-box;
    transform: scale(0.9);
    transition: transform 0.25s ease;
    border: 1px solid var(--border-color);
}

.modal-overlay.show .modal-box {
    transform: scale(1);
}

.modal-box h3 {
    margin-top: 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
}

.modal-box p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* Modal Action Buttons Grid */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

    .modal-actions button {
        flex: 1;
        padding: 10px 16px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 6px;
        cursor: pointer;
        border: none;
        font-family: inherit;
        transition: background 0.2s;
    }

/* Pop-up Cancel/Back Button */
.btn-popup-cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1 !important;
}

    .btn-popup-cancel:hover {
        background: #e2e8f0;
    }

/* Discard/Danger Button */
.btn-danger-popup {
    background: #ef4444;
    color: white;
}

    .btn-danger-popup:hover {
        background: #dc2626;
    }

@media screen and (max-width: 480px) {
    .modal-actions {
        flex-direction: column; /* मोबाइल पर बटन्स ऊपर-नीचे हो जाएंगे */
    }
}
 
/* --- Link Modal Overlay --- */
.link-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* High z-index */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Open State */
.link-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* --- Link Modal Content Box --- */
.link-modal-box {
    background: #ffffff;
    padding: 28px 24px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 420px;
    position: relative;
    box-sizing: border-box;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    border: 1px solid var(--border-color);
}

.link-modal-overlay.show .link-modal-box {
    transform: scale(1);
}

/* Close Cross Icon */
.link-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

    .link-modal-close:hover {
        color: #334155;
    }

.link-modal-box h3 {
    margin: 0 0 6px 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-modal-box p {
    margin: 0 0 20px 0;
    color: #64748b;
    font-size: 13px;
}

/* --- Form Elements Inside Modal --- */
.link-form-group {
    margin-bottom: 16px;
    text-align: left;
}

    .link-form-group label {
        display: block;
        margin-bottom: 6px;
        font-size: 13px;
        font-weight: 600;
        color: #475569;
    }

/* --- Grid Buttons Inside Modal --- */
.link-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

    .link-modal-actions button {
        padding: 10px 20px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 6px;
        cursor: pointer;
        border: none;
        font-family: inherit;
        transition: background 0.2s;
    }

.btn-link-cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1 !important;
}

    .btn-link-cancel:hover {
        background: #e2e8f0;
    }

.btn-link-submit {
    background: var(--primary-color);
    color: white;
}

    .btn-link-submit:hover {
        background: var(--primary-hover);
    }





/* --- Link Modal Overlay --- */
.link-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* High z-index */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Open State */
.link-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* --- Link Modal Content Box --- */
.link-modal-box {
    background: #ffffff;
    padding: 28px 24px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 420px;
    position: relative;
    box-sizing: border-box;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    border: 1px solid var(--border-color);
}

.link-modal-overlay.show .link-modal-box {
    transform: scale(1);
}

/* Close Cross Icon */
.link-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

    .link-modal-close:hover {
        color: #334155;
    }

.link-modal-box h3 {
    margin: 0 0 6px 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-modal-box p {
    margin: 0 0 20px 0;
    color: #64748b;
    font-size: 13px;
}

/* --- Form Elements Inside Modal --- */
.link-form-group {
    margin-bottom: 16px;
    text-align: left;
}

    .link-form-group label {
        display: block;
        margin-bottom: 6px;
        font-size: 13px;
        font-weight: 600;
        color: #475569;
    }

/* --- Grid Buttons Inside Modal --- */
.link-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

    .link-modal-actions button {
        padding: 10px 20px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 6px;
        cursor: pointer;
        border: none;
        font-family: inherit;
        transition: background 0.2s;
    }

.btn-link-cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1 !important;
}

    .btn-link-cancel:hover {
        background: #e2e8f0;
    }

.btn-link-submit {
    background: var(--primary-color);
    color: white;
}

    .btn-link-submit:hover {
        background: var(--primary-hover);
    }

@media screen and (max-width: 480px) {
    .link-modal-actions {
        flex-direction: column-reverse;
    }

        .link-modal-actions button {
            width: 100%;
        }
}

