/**
 * Frontend uređivanje stavki - CSS stilovi
 * @since 2.9.11
 */

/* ==========================================================================
   Edit Stavka Wrapper
   ========================================================================== */
.itwp-edit-stavka-wrapper {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.itwp-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.itwp-edit-title-container {
    flex: 1;
}

.itwp-edit-title {
    margin: 0 0 0.5rem 0;
    font-size: 22px;
    font-weight: 700;
    color: #243C7B;
}

.itwp-edit-stavka-name {
    font-size: 16px;
    color: #333;
    font-weight: 400;
    line-height: 1.5;
}

.itwp-back-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    white-space: nowrap;
    margin-top: 0.25rem;
}

.itwp-back-link:hover {
    color: #005177;
    text-decoration: underline;
}

/* ==========================================================================
   Edit Table
   ========================================================================== */
.itwp-table-scroll-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.itwp-edit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.itwp-edit-table thead th {
    background: #f5f5f5;
    padding: 8px 3px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.itwp-edit-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.itwp-edit-table tbody tr:hover {
    background-color: #f9f9f9;
}

.itwp-edit-table tbody td {
    padding: 6px 3px;
    vertical-align: middle;
    font-size: 13px;
    font-weight: 400;
}

/* Stilizovanje zadataka */
.itwp-edit-task-row {
    background: #fafafa;
}

.itwp-edit-task-row .itwp-naziv-cell {
    font-weight: 400;
    font-size: 13px;
    color: #222;
}

/* Stilizovanje koraka */
.itwp-edit-korak-row {
    background: #fff;
}

.itwp-edit-korak-row .itwp-naziv-cell {
    font-weight: 400;
    font-size: 13px;
    color: #555;
    padding-left: 20px;
}

/* Kolone */
.itwp-redosled-cell {
    text-align: center;
    font-size: 13px;
    font-weight: 400;
    color: #888;
}

.itwp-naziv-cell {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}

.itwp-checkbox-cell {
    text-align: center;
    padding-left: 2px !important;
    padding-right: 2px !important;
}

.itwp-checkbox-cell label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.itwp-checkbox-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.itwp-checkbox-cell span {
    font-size: 12px;
    font-weight: 400;
    color: #666;
    white-space: nowrap;
}

/* ==========================================================================
   Actions Footer
   ========================================================================== */
.itwp-edit-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.itwp-save-btn {
    padding: 12px 24px;
    background: linear-gradient(to bottom, #2ea2cc 0%, #1e8cbe 100%);
    color: #fff;
    border: 1px solid #0074a2;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

.itwp-save-btn:hover {
    background: linear-gradient(to bottom, #1e8cbe 0%, #1675a9 100%);
    border-color: #005e8a;
}

.itwp-save-btn:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.itwp-save-btn:disabled {
    background: #ccc;
    border-color: #bbb;
    cursor: not-allowed;
    opacity: 0.6;
}

.itwp-cancel-btn {
    padding: 12px 24px;
    background: #f7f7f7;
    color: #555;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.itwp-cancel-btn:hover {
    background: #e7e7e7;
    color: #333;
}

/* Messages */
.itwp-edit-message {
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-left: auto;
}

.itwp-edit-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.itwp-edit-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Error message container */
.itwp-error-message {
    padding: 16px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
    font-size: 16px;
}

/* ==========================================================================
   Edit Link in Main Table
   ========================================================================== */
.itwp-edit-link {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(to bottom, #f7f7f7 0%, #e7e7e7 100%);
    color: #555;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.itwp-edit-link:hover {
    background: linear-gradient(to bottom, #e7e7e7 0%, #d7d7d7 100%);
    color: #333;
    border-color: #bbb;
}

.itwp-edit-link:active {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .itwp-edit-stavka-wrapper {
        padding: 0.75rem;
    }
    
    .itwp-edit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .itwp-edit-title {
        font-size: 18px;
    }
    
    .itwp-edit-stavka-name {
        font-size: 14px;
    }
    
    .itwp-edit-table {
        font-size: 12px;
    }
    
    .itwp-edit-table thead th {
        padding: 6px 2px;
        font-size: 12px;
    }
    
    .itwp-edit-table tbody td {
        padding: 5px 2px;
        font-size: 12px;
    }
    
    /* Sakrij tekstove "Započni" i "Završi" na mobilnoj verziji */
    .itwp-checkbox-cell span {
        display: none;
    }
    
    .itwp-checkbox-cell label {
        justify-content: center;
        gap: 0;
    }
    
    .itwp-edit-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .itwp-save-btn,
    .itwp-cancel-btn {
        width: 100%;
        text-align: center;
    }
    
    .itwp-edit-message {
        margin-left: 0;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .itwp-edit-title {
        font-size: 16px;
    }
    
    .itwp-edit-table {
        font-size: 11px;
    }
    
    .itwp-edit-table thead th {
        font-size: 11px;
        padding: 5px 2px;
    }
    
    .itwp-edit-table tbody td {
        font-size: 11px;
        padding: 4px 2px;
    }
    
    /* Hide Redosled column on small mobile */
    .itwp-edit-table th:first-child,
    .itwp-edit-table td:first-child {
        display: none;
    }
    
    .itwp-checkbox-cell input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }
}
