/* ========================================
   Design Management System Styles
   استخدام ألوان المشروع الأساسية
   ======================================== */

/* استخدام متغيرات CSS من custom-theme.css */

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* Status Cards - محسنة مع الألوان الأساسية */
.stat-card {
    border: none;
    border-radius: var(--border-radius-lg, 15px);
    box-shadow: 0 4px 20px var(--shadow-light, rgba(76, 175, 80, 0.1));
    transition: all var(--transition-normal, 0.3s ease);
    overflow: hidden;
    position: relative;
    animation: scaleIn 0.5s ease-out;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 1));
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px var(--shadow-medium, rgba(76, 175, 80, 0.2));
}

.stat-card .card-body {
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

.stat-card h3 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, currentColor, rgba(255, 255, 255, 0.9));
    -webkit-background-clip: text;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

.stat-card p {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 4rem;
    opacity: 0.15;
    position: absolute;
    left: -10px;
    bottom: -10px;
    animation: rotateIn 0.8s ease-out;
}

/* Task Cards - تحسين باستخدام الألوان الأساسية */
.task-card {
    border: 2px solid var(--border-color, #C8E6C9);
    border-radius: var(--border-radius-lg, 15px);
    transition: all var(--transition-normal, 0.3s ease);
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 10px var(--shadow-light, rgba(76, 175, 80, 0.1));
    position: relative;
    animation: fadeInUp 0.5s ease-out;
}

.task-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-light, #66BB6A) 50%, transparent);
    opacity: 0;
    transition: all 0.5s ease;
    pointer-events: none;
}

.task-card:hover::after {
    width: 100%;
    opacity: 0.1;
}

.task-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 25px var(--shadow-medium, rgba(76, 175, 80, 0.2));
    border-color: var(--primary-color, #4CAF50);
}

.task-card.border-primary {
    border-right: 5px solid var(--primary-color, #4CAF50);
}

.task-card.border-warning {
    border-right: 5px solid var(--warning-color, #FF9800);
}

.task-card.border-success {
    border-right: 5px solid var(--success-color, #2E7D32);
}

.task-card.border-danger {
    border-right: 5px solid var(--error-color, #D32F2F);
}

/* Status Badges - تحسين مع الألوان الأساسية */
.badge {
    font-weight: 600;
    padding: 0.6em 1em;
    font-size: 0.85rem;
    border-radius: var(--border-radius, 8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-fast, 0.2s ease);
    position: relative;
    overflow: hidden;
    animation: fadeInRight 0.4s ease-out;
}

.badge::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s, top 0.6s, right 0.6s;
    transform: translate(50%, -50%);
}

.badge:hover::before {
    width: 300px;
    height: 300px;
    top: 50%;
    right: 50%;
}

.badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Priority Badges with Project Colors */
.badge.bg-danger {
    background: linear-gradient(135deg, var(--error-color, #D32F2F) 0%, #c62828 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--warning-color, #FF9800) 0%, #f57c00 100%) !important;
    color: #fff !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, var(--info-color, #1976D2) 0%, #1565c0 100%) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-color, #2E7D32) 0%, #1b5e20 100%) !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color, #4CAF50) 0%, var(--primary-dark, #45a049) 100%) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, var(--secondary-color, #6c757d) 0%, var(--secondary-dark, #5a6268) 100%) !important;
}

.badge.bg-dark {
    background: linear-gradient(135deg, #424242 0%, #212121 100%) !important;
}

/* File Drop Area - محسنة مع ألوان المشروع */
.file-drop-area {
    border: 3px dashed var(--border-color, #C8E6C9);
    border-radius: var(--border-radius-lg, 15px);
    padding: 3rem 2rem;
    text-align: center;
    transition: all var(--transition-normal, 0.3s ease);
    cursor: pointer;
    background: var(--light-bg, #f8f9fa);
    position: relative;
    overflow: hidden;
}

.file-drop-area::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-light, #66BB6A) 0%, transparent 70%);
    opacity: 0;
    transition: all 0.5s ease;
    transform: translate(50%, -50%);
}

.file-drop-area:hover::before,
.file-drop-area.highlight::before {
    width: 500px;
    height: 500px;
    opacity: 0.1;
}

.file-drop-area:hover,
.file-drop-area.highlight {
    border-color: var(--primary-color, #4CAF50);
    background: linear-gradient(135deg, var(--success-bg, #E8F5E9) 0%, rgba(76, 175, 80, 0.05) 100%);
    box-shadow: 0 8px 25px var(--shadow-medium, rgba(76, 175, 80, 0.2));
    transform: scale(1.02);
}

.file-drop-icon {
    margin-bottom: 1rem;
    color: var(--medium-gray, #6c757d);
    transition: all var(--transition-normal, 0.3s ease);
}

.file-drop-area:hover .file-drop-icon,
.file-drop-area.highlight .file-drop-icon {
    color: var(--primary-color, #4CAF50);
    animation: bounce 0.6s ease-in-out;
    transform: scale(1.2);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1.2); }
    50% { transform: translateY(-15px) scale(1.3); }
}

.file-input {
    display: none;
}

/* Requirements Box */
.requirements-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.25rem;
    border-radius: 8px;
    border-right: 4px solid var(--primary-color, #4CAF50);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Timeline Styles - محسنة بألوان المشروع */
.timeline {
    position: relative;
    padding: 20px 0;
    padding-right: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 14px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, 
        var(--primary-color, #4CAF50) 0%, 
        var(--primary-light, #66BB6A) 50%,
        var(--border-color, #C8E6C9) 100%);
    border-radius: var(--border-radius-sm, 4px);
    box-shadow: 0 0 10px var(--shadow-light, rgba(76, 175, 80, 0.1));
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    opacity: 1;
    animation: slideInTimeline 0.6s ease-out;
}

@keyframes slideInTimeline {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.15s; }
.timeline-item:nth-child(4) { animation-delay: 0.2s; }
.timeline-item:nth-child(5) { animation-delay: 0.25s; }
.timeline-item:nth-child(6) { animation-delay: 0.3s; }
.timeline-item:nth-child(7) { animation-delay: 0.35s; }
.timeline-item:nth-child(8) { animation-delay: 0.4s; }
.timeline-item:nth-child(9) { animation-delay: 0.45s; }
.timeline-item:nth-child(10) { animation-delay: 0.5s; }

.timeline-marker {
    position: absolute;
    right: -21px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2), 0 0 0 4px white;
    border: 3px solid white;
    animation: pulseMarker 2s ease-in-out infinite;
    transition: all var(--transition-normal, 0.3s ease);
}

@keyframes pulseMarker {
    0%, 100% { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2), 0 0 0 4px white; }
    50% { box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3), 0 0 0 6px white, 0 0 0 10px rgba(76, 175, 80, 0.2); }
}

.timeline-marker:hover {
    transform: scale(1.2);
    animation: none;
}

.timeline-marker.bg-success {
    background: linear-gradient(135deg, var(--success-color, #2E7D32) 0%, #1b5e20 100%);
}

.timeline-marker.bg-primary {
    background: linear-gradient(135deg, var(--primary-color, #4CAF50) 0%, var(--primary-dark, #45a049) 100%);
}

.timeline-marker.bg-info {
    background: linear-gradient(135deg, var(--info-color, #1976D2) 0%, #1565c0 100%);
}

.timeline-marker.bg-danger {
    background: linear-gradient(135deg, var(--error-color, #D32F2F) 0%, #c62828 100%);
}

.timeline-marker.bg-warning {
    background: linear-gradient(135deg, var(--warning-color, #FF9800) 0%, #f57c00 100%);
}

.timeline-content {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius, 8px);
    border: 2px solid var(--border-color, #C8E6C9);
    box-shadow: 0 3px 8px var(--shadow-light, rgba(76, 175, 80, 0.1));
    transition: all var(--transition-normal, 0.3s ease);
    position: relative;
    overflow: hidden;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color, #4CAF50), var(--primary-light, #66BB6A));
    opacity: 0;
    transition: all var(--transition-normal, 0.3s ease);
}

.timeline-content:hover::before {
    opacity: 1;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.05));
}

.timeline-content:hover {
    box-shadow: 0 6px 20px var(--shadow-medium, rgba(76, 175, 80, 0.2));
    transform: translateX(8px) scale(1.02);
    border-color: var(--primary-color, #4CAF50);
}

.timeline-content strong {
    color: var(--text-primary, #1B5E20);
    font-size: 1.05rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    margin: 0.5rem 0 0.25rem;
    color: var(--medium-gray, #6c757d);
    line-height: 1.6;
}

.timeline-content small {
    color: var(--secondary-color, #6c757d);
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Info Card Items */
.info-item {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.info-item:hover {
    padding-right: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.info-item small {
    display: block;
    color: #868e96;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item strong {
    color: #212529;
    font-size: 1rem;
}

/* Revision Items */
.revision-item {
    background: white;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.revision-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Actions Container */
.actions-container .btn {
    margin-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.actions-container .btn-group {
    gap: 0.5rem;
}

/* File List Items */
.list-group-item {
    border: 1px solid #e9ecef;
    border-radius: 6px !important;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(5px);
}

/* Modal Customization */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 2px solid #e9ecef;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: #212529;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 2px solid #e9ecef;
    padding: 1rem 1.5rem;
}

/* Button Enhancements - بألوان المشروع */
.btn {
    border-radius: var(--border-radius, 8px);
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    transition: all var(--transition-normal, 0.3s ease);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s, top 0.6s, right 0.6s;
    transform: translate(50%, -50%);
}

.btn:hover::before {
    width: 300%;
    height: 300%;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #4CAF50) 0%, var(--primary-dark, #45a049) 100%);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark, #45a049) 0%, var(--success-color, #2E7D32) 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color, #2E7D32) 0%, #1b5e20 100%);
    border: none;
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color, #FF9800) 0%, #f57c00 100%);
    border: none;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color, #D32F2F) 0%, #c62828 100%);
    border: none;
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color, #1976D2) 0%, #1565c0 100%);
    border: none;
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color, #4CAF50);
    color: var(--primary-color, #4CAF50);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color, #4CAF50);
    color: white;
}

/* Card Enhancements - بألوان المشروع */
.card {
    border: 2px solid var(--border-color, #C8E6C9);
    border-radius: var(--border-radius-lg, 15px);
    box-shadow: 0 3px 10px var(--shadow-light, rgba(76, 175, 80, 0.1));
    transition: all var(--transition-normal, 0.3s ease);
    background: white;
    overflow: hidden;
    position: relative;
    animation: fadeInUp 0.5s ease-out;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--primary-color, #4CAF50), 
        var(--primary-light, #66BB6A),
        var(--success-color, #2E7D32));
    opacity: 0;
    transition: opacity var(--transition-normal, 0.3s ease);
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    box-shadow: 0 8px 25px var(--shadow-medium, rgba(76, 175, 80, 0.2));
    transform: translateY(-5px);
    border-color: var(--primary-color, #4CAF50);
}

.card-header {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05), transparent);
    border-bottom: 2px solid var(--border-color, #C8E6C9);
    padding: 1.5rem;
}

.card-header h5 {
    margin-bottom: 0;
    font-weight: 700;
    color: var(--text-primary, #1B5E20);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h5 i {
    color: var(--primary-color, #4CAF50);
    animation: rotateIn 0.6s ease-out;
}

.card-body {
    padding: 1.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .stat-card h3 {
        font-size: 2rem;
    }

    .timeline {
        padding-right: 25px;
    }

    .timeline::before {
        right: 8px;
    }

    .timeline-marker {
        right: -15.5px;
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .file-drop-area {
        padding: 2rem 1rem;
    }
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Alerts Enhancement - بألوان المشروع */
.alert {
    border-radius: var(--border-radius, 8px);
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border-right: 5px solid;
    animation: slideDown 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: shimmer 2s infinite;
}

.alert-success {
    background: linear-gradient(135deg, var(--success-bg, #E8F5E9) 0%, rgba(76, 175, 80, 0.1) 100%);
    color: var(--success-color, #2E7D32);
    border-right-color: var(--success-color, #2E7D32);
}

.alert-danger {
    background: linear-gradient(135deg, var(--error-bg, #FFEBEE) 0%, rgba(211, 47, 47, 0.1) 100%);
    color: var(--error-color, #D32F2F);
    border-right-color: var(--error-color, #D32F2F);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, rgba(255, 152, 0, 0.1) 100%);
    color: var(--warning-color, #FF9800);
    border-right-color: var(--warning-color, #FF9800);
}

.alert-info {
    background: linear-gradient(135deg, var(--info-bg, #E3F2FD) 0%, rgba(25, 118, 210, 0.1) 100%);
    color: var(--info-color, #1976D2);
    border-right-color: var(--info-color, #1976D2);
}

.alert i {
    margin-left: 0.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Print Styles */
@media print {
    .btn, .actions-container, .modal, .navbar, .file-drop-area {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }

    .timeline-content:hover {
        transform: none !important;
    }
}
