/* ==========================================
   Depositor Investor Premium Styles (Hybrid)
   Merging DI-Premium features with DIS-Premium Responsive UI
   ========================================== */

/* --- INHERITED: DIS-Premium Core Styles (Responsive, No Scroll) --- */

/* Modal Styles */
.di-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999; /* High z-index like DIS */
    display: none;
}

.di-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: disSlideInUp 0.4s ease;
    overflow: hidden;
    z-index: 2;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes disSlideInUp {
    from {
        transform: translate(-50%, -40%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity:1;
    }
}

.di-modal-header {
    background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
    padding: 15px 20px;
    color: white;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.di-modal-header i {
    font-size: 35px;
    margin-bottom: 5px;
}

.di-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.di-modal-header p {
    margin:3px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

/* Overlay styles (Required) */
.di-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: disFadeIn 0.3s ease;
    z-index: 1; /* Behind content, in front of page */
}

@keyframes disFadeIn {
    from { opacity: 0; }
    to { opacity:1; }
}

/* Fix Close Button Positioning */
/* We move it to the top-right of the CONTENT, not HEADER */
.di-close {
    position: absolute;
    right: 15px;
    top: 15px;
    z-index: 10; /* Ensure it is above everything */
    color: #333; /* Darker color for visibility against white content bg */
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.di-close:hover {
    color: #333;
    transform: rotate(90deg);
}

.di-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Hide scrollbar but keep functionality (DIS Style) */
.di-modal-body {
    scrollbar-width: thin;
    scrollbar-color: #e74c3c #f1f1f1;
}

.di-modal-body::-webkit-scrollbar {
    width: 4px;
}

.di-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.di-modal-body::-webkit-scrollbar-thumb {
    background: #e74c3c;
    border-radius: 10px;
}

/* Form Styles - Compact but comfortable (DIS Style) */
.di-form-group {
    margin-bottom: 12px;
}

.di-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.required {
    color: #e74c3c;
}

.di-form-group input[type="text"],
.di-form-group input[type="email"],
.di-form-group input[type="number"],
.di-form-group select,
.di-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.di-form-group input:focus,
.di-form-group select:focus,
.di-form-group textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.di-form-group input[type="file"] {
    padding: 6px 10px;
    background: #f8f9fa;
    font-size: 12px;
    border: none;
}

.di-form-group small {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    color: #666;
}

/* CAPTCHA (DIS Style) */
.di-captcha-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.di-captcha-question {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: white;
    min-width: 90px;
    text-align: center;
}

.di-captcha-group input {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px !important;
}

.di-preview-box {
    background: linear-gradient(135deg, #e8f4fd 0%, #d4edda 100%);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    color: #e74c3c;
    font-size: 14px; /* Slightly smaller for compact layout */
    text-align: center;
    border-left: 4px solid #e74c3c;
}

.di-submit-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.di-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.4);
}

.di-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   RESPONSIVE - FITS ALL SCREENS WITHOUT SCROLL (DIS Style)
   ========================================== */

/* Desktop */
@media (min-width: 1024px) {
    .di-modal-content {
        max-width: 480px;
        max-height: 85vh;
    }
    .di-modal-body {
        padding: 20px 25px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1023px) {
    .di-modal-content {
        max-width: 450px;
        max-height: 85vh;
    }
}

/* Small Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .di-modal-content {
        max-width: 420px;
        max-height: 85vh;
    }
    .di-modal-header {
        padding: 12px 15px;
    }
    .di-modal-body {
        padding: 15px 20px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .di-modal-content {
        width: 92%;
        max-width: 380px;
        max-height: 90vh;
    }
    .di-modal-header {
        padding: 10px 12px;
    }
    .di-modal-header i {
        font-size: 25px;
        margin-bottom: 3px;
    }
    .di-modal-header h2 {
        font-size: 16px;
    }
    .di-modal-header p {
        font-size: 10px;
    }
    .di-close {
        right: 8px;
        top: 8px;
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
    .di-modal-body {
        padding: 12px 15px;
    }
    .di-form-group {
        margin-bottom: 8px;
    }
    .di-form-group label {
        font-size: 12px;
        margin-bottom: 3px;
    }
    .di-form-group input[type="text"],
    .di-form-group input[type="email"],
    .di-form-group input[type="number"] {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    /* CAPTCHA on mobile */
    .di-captcha-group {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .di-captcha-question {
        text-align: center;
        padding: 5px 10px;
        font-size: 13px;
    }
    .di-captcha-group input {
        width: 100%;
    }
    
    .di-submit-btn {
        padding: 8px;
        font-size: 13px;
        margin-top: 10px;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .di-modal-content {
        width: 95%;
        max-height: 92vh;
    }
    .di-modal-body {
        padding: 10px 12px;
    }
    .di-form-group {
        margin-bottom: 7px;
    }
    .di-form-group input {
        padding: 5px 7px;
        font-size: 11px;
    }
    .di-submit-btn {
        padding: 7px;
        font-size: 12px;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .di-modal-content {
        max-height: 95vh;
    }
    .di-modal-header {
        padding: 8px 12px;
    }
    .di-modal-header i {
        font-size: 20px;
        margin-bottom: 2px;
    }
    .di-modal-header h2 {
        font-size: 14px;
    }
    .di-modal-header p {
        display: none;
    }
    .di-modal-body {
        padding: 10px 15px;
    }
    .di-form-group {
        margin-bottom: 6px;
    }
    .di-form-group input {
        padding: 5px 8px;
    }
    .di-submit-btn {
        padding: 6px;
        margin-top: 8px;
    }
}

/* --- INHERITED: DI-Premium Component Styles --- */

/* Container & Buttons */
.di-container {
    text-align: center;
    padding: 20px;
}

.di-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.di-button-depositor {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.di-button-depositor:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.di-button-investor {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.di-button-investor:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.di-button-small {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.di-button-small:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.di-button-success {
    background: #27ae60 !important;
    color: white !important;
}

/* Dashboard Grid */
.di-user-dashboard {
    margin: 30px 0;
}

.di-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.di-dashboard-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.di-dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.di-card-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(243, 156, 18, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.di-card-icon i {
    font-size: 32px;
    color: #e74c3c;
}

.di-dashboard-card h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.di-card-amount {
    font-size: 28px;
    font-weight: 700;
    color: #e74c3c;
    margin: 10px 0;
}

.di-card-info {
    font-size: 13px;
    color: #666;
    margin: 5px 0;
}

/* Badges & Status */
.di-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
}

.di-badge-success {
    background: #27ae60;
    color: white;
}

.di-status-active {
    display: inline-block;
    padding: 4px 12px;
    background: #d4edda;
    color: #155724;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.di-status-pending {
    display: inline-block;
    padding: 4px 12px;
    background: #fff3cd;
    color: #856404;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.di-status-withdraw {
    display: inline-block;
    padding: 4px 12px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Loading Spinner */
.di-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: disSpin 0.8s linear infinite;
}

@keyframes disSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* SweetAlert Customization */
.swal2-popup {
    border-radius: 20px !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, #e74c3c, #f39c12) !important;
    border-radius: 50px !important;
}

/* Fix SweetAlert appearing behind custom modal */
.swal2-container {
    z-index: 9999999 !important;
}

.di-swal-over-modal {
    z-index: 9999999 !important;
}

/* Terms & Conditions Styles */
.di-terms-group {
    margin: 15px 0 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.di-terms-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    flex: 1;
}

.di-terms-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.di-terms-checkbox a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.di-terms-checkbox a:hover {
    text-decoration: underline;
    color: #c0392b;
}

/* Matured Investment Button */
.di-matured-actions {
    margin-top: 15px;
    text-align: center;
}

.di-button-matured {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.3);
}

.di-button-matured:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(39, 174, 96, 0.4);
}

.di-button-matured i {
    font-size: 16px;
}

@media (max-width: 480px) {
    .di-terms-group {
        flex-direction: column;
    }
    .di-terms-checkbox {
        width: 100%;
    }
    .di-button-matured {
        width: 100%;
        padding: 10px 15px;
    }
}

/* ==========================================
   Terms & Conditions Styles
   ========================================== */

/* Terms Checkbox Styles */
.di-terms-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    margin: 15px 0 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.di-terms-checkbox:hover {
    background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
    border-color: #e74c3c;
}

.di-terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    accent-color: #e74c3c;
}

.di-terms-checkbox span {
    flex: 1;
}

.di-terms-checkbox a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
}

.di-terms-checkbox a:hover {
    text-decoration: underline;
}

/* Terms Button Styles - Investment Status Page */
.di-investment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.di-button-terms {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.di-button-terms:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    color: white;
    text-decoration: none;
}

.di-button-terms i {
    font-size: 14px;
}

/* Success Message for Matured Investment */
.di-success-message {
    margin: 15px 0;
    padding: 12px 15px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 10px;
    text-align: center;
    color: #155724;
    font-weight: 500;
    border-left: 4px solid #28a745;
}

.di-success-message i {
    color: #28a745;
    font-size: 18px;
    margin-right: 8px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .di-investment-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .di-button-terms {
        width: 100%;
        justify-content: center;
    }
    
    .di-terms-checkbox {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .di-terms-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .di-terms-checkbox {
        flex-wrap: wrap;
    }
}