.naam-assignment-container {
    max-width: 100%;
    margin: 20px auto;
}

.naam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #768F9B;
    padding: 8px 20px;
    border-radius: 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.naam-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
}

.naam-content-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.naam-main-content {
    flex: 0 0 82%;
    background: #fff;
    border-radius: 10px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.naam-sidebar {
    flex: 0 0 17%;
    background-color: #fff;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.naam-assignments-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin: 0;
}

.naam-assignments-table th,
.naam-assignments-table td {
    border: 1px solid #e0e0e0;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.naam-assignments-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

.naam-assignments-table td {
    background-color: #fff;
}

/* Column widths */
.naam-assignments-table th:nth-child(1), /* شماره */
.naam-assignments-table td:nth-child(1) {
    width: 8%;
}

.naam-assignments-table th:nth-child(2), /* دوره مرتبط */
.naam-assignments-table td:nth-child(2) {
    width: 22%;
}

.naam-assignments-table th:nth-child(3), /* فایل تمرین */
.naam-assignments-table td:nth-child(3) {
    width: 15%;
}

.naam-assignments-table th:nth-child(4), /* توضیحات */
.naam-assignments-table td:nth-child(4) {
    width: 38%;
}

.naam-assignments-table th:nth-child(5), /* نوع تمرین */
.naam-assignments-table td:nth-child(5) {
    width: 8%;
}

.naam-assignments-table th:nth-child(6), /* حذف */
.naam-assignments-table td:nth-child(6) {
    width: 3%;
}

/* Text alignment for inputs and selects */
.naam-assignments-table input[type="text"],
.naam-assignments-table select,
.naam-assignments-table .custom-file-btn {
    text-align: center;
}

.naam-assignments-table textarea {
    text-align: right;
}

.course-select {
    text-align: center !important;
    text-align-last: center;
}

/* Custom file input */
.custom-file-input {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 38px;
}

.custom-file-input input[type="file"] {
    display: none;
}

.custom-file-btn {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    color: #555;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    line-height: 22px;
}

.custom-file-btn:hover {
    background-color: #e9ecef;
}

.custom-file-btn.has-file {
    background-color: #e8f5e9;
    border-color: #a5d6a7;
    color: #2e7d32;
    text-align: left;
    direction: rtl;
    font-size: 0.65rem;
    line-height: 18px;
}

.custom-file-btn.has-file::before {
    content: '...';
    margin-left: 5px;
}

/* Remove button */
.remove-row-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #dc3545!important;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.remove-row-btn:hover {
    opacity: 1;
}

.remove-row-btn i {
    font-size: 1.2rem;
}

/* Form controls */
input[type="text"],
select,
textarea,
.custom-file-btn {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.9rem;
    height: 38px;
    line-height: 20px;
    box-sizing: border-box;
}

textarea {
    resize: none;
    height: 38px;
    overflow: auto;
}

select {
    background-color: #fff;
    cursor: pointer;
}

.add-row-btn {
    background-color: #8BA1AD;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-row-btn:hover {
    background-color: #5D7380;
}

.submit-assignments-btn {
    background-color: #8BA1AD;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.submit-assignments-btn:hover {
    background-color: #5D7380;
}

.submission-notice {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.notice-item {
    position: relative;
    padding: 10px 0;
}

.notice-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 10%;
    right: 10%;
    height: 1px;
    background-color: #e0e0e0;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.error {
    border-color: #dc3545 !important;
}

/* Hover effects */
.naam-assignments-table tr:hover td {
    background-color: #f8f9fa;
} 


.voice-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.voice-wrapper textarea {
    flex: 1;
}

.record-voice-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    margin-right: 8px;
    color: #666!important;
    cursor: pointer;
}

.recording .record-voice-btn i {
    color: red!important;
}

.playing .record-voice-btn i {
    color: green!important;
}


.remove-voice-btn {
    background: none;
    border: none;
    font-size: 16px;
    margin-right: 5px;
    color: #e74c3c!important;
    cursor: pointer;
    padding: 0;
}
.remove-voice-btn:hover {
    color: #c0392b!important;
}


.styled-voice-btn {
    padding: 2px 6px;
    border: 2px solid #0073aa;
    border-radius: 4px;
    background: white;
    color: #0073aa;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    
    /* 👇 برای هم‌تراز شدن با دکمه "مشاهده" */
    height: 24px;
    line-height: 24px;
    vertical-align: middle;
    margin-top: 1px;
    margin-left: 6px;
    display: inline-block;
}
.styled-voice-btn:hover {
    background: #0073aa;
    color: white;
}
.styled-voice-btn.playing {
    border-color: #e74c3c;
    color: #e74c3c;
}
.styled-voice-btn.empty-voice {
    padding: 2px 6px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: #f9f9f9;
    color: #999;
    font-size: 13px;
    height: 24px;
    width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    margin-left: 6px;
    cursor: default;
    pointer-events: none;
}
.assignment-success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f0fff5;
    border: 2px solid #4CAF50;
    padding: 25px 30px;
    border-radius: 8px;
    z-index: 9999;
    text-align: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.assignment-success-popup .popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.assignment-success-popup .success-icon {
    font-size: 36px;
    color: #4CAF50;
    margin-bottom: 10px;
}

.assignment-success-popup p {
    font-size: 16px;
    color: #333;
    margin: 0;
}
