/**
 * Windows XP Dialog System
 * Alert, confirmation, and input dialogs with authentic XP styling
 */

/* Dialog Overlay */
.xp-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Dialog Box */
.xp-dialog {
    background: #ece9d8;
    border: 2px solid #0054e3;
    border-radius: 8px 8px 0 0;
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.4);
    min-width: 300px;
    max-width: 600px;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Dialog Title Bar */
.xp-dialog-titlebar {
    background: linear-gradient(to bottom, #0058e6 0%, #3a93ff 5%, #0054e3 50%, #003cb3 100%);
    color: white;
    padding: 5px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px 6px 0 0;
    font-weight: bold;
    font-size: 13px;
    font-family: "Trebuchet MS", Tahoma, sans-serif;
}

.xp-dialog-close {
    width: 21px;
    height: 21px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: linear-gradient(to bottom, #e06c5e 0%, #c94c3c 50%, #b83d2e 100%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.xp-dialog-close:hover {
    background: linear-gradient(to bottom, #f07c6e 0%, #d95c4c 50%, #c84d3e 100%);
    border-color: white;
}

.xp-dialog-close:active {
    background: linear-gradient(to bottom, #a82d1e 0%, #b83d2e 100%);
}

/* Dialog Content */
.xp-dialog-content {
    padding: 20px;
    background: white;
    margin: 3px;
    border: 1px solid #d0d0d0;
}

.xp-dialog-icon {
    width: 32px;
    height: 32px;
    margin-right: 15px;
    float: left;
    flex-shrink: 0;
}

.xp-dialog-message {
    font-size: 12px;
    line-height: 1.6;
    color: #000;
    font-family: Tahoma, sans-serif;
    word-wrap: break-word;
}

.xp-dialog-message-wrapper {
    display: flex;
    align-items: flex-start;
}

/* Dialog Buttons */
.xp-dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #d0d0d0;
}

/* XP Style Buttons */
.xp-btn {
    padding: 6px 20px;
    background: linear-gradient(to bottom, #ffffff 0%, #ece9d8 100%);
    border: 1px solid #003c74;
    border-radius: 3px;
    color: #000;
    font-size: 12px;
    font-family: Tahoma, sans-serif;
    cursor: pointer;
    min-width: 75px;
    transition: all 0.1s;
}

.xp-btn:hover {
    background: linear-gradient(to bottom, #ffffff 0%, #d6d0b8 100%);
    border-color: #0054e3;
}

.xp-btn:active {
    background: linear-gradient(to bottom, #d6d0b8 0%, #c6c0a8 100%);
}

.xp-btn:focus {
    outline: 1px dotted #000;
    outline-offset: -4px;
}

.xp-btn-primary {
    background: linear-gradient(to bottom, #3c8cf8 0%, #1e5edc 100%);
    color: white;
    border-color: #003c74;
}

.xp-btn-primary:hover {
    background: linear-gradient(to bottom, #5ca8ff 0%, #3e7efc 100%);
    border-color: #0054e3;
}

.xp-btn-primary:active {
    background: linear-gradient(to bottom, #0e4edc 0%, #1e5edc 100%);
}

.xp-btn-danger {
    background: linear-gradient(to bottom, #e06c5e 0%, #c94c3c 100%);
    color: white;
    border-color: #8b2e1e;
}

.xp-btn-danger:hover {
    background: linear-gradient(to bottom, #f07c6e 0%, #d95c4c 100%);
    border-color: #a03e2e;
}

/* Alert Variants */
.xp-alert-success .xp-dialog-icon {
    content: url('../images/Windows%20XP%20High%20Resolution%20Icon%20Pack/Windows%20XP%20Icons/Information.png');
}

.xp-alert-error .xp-dialog-icon {
    content: url('../images/Windows%20XP%20High%20Resolution%20Icon%20Pack/Windows%20XP%20Icons/Critical.png');
}

.xp-alert-warning .xp-dialog-icon {
    content: url('../images/Windows%20XP%20High%20Resolution%20Icon%20Pack/Windows%20XP%20Icons/Important.png');
}

.xp-alert-info .xp-dialog-icon {
    content: url('../images/Windows%20XP%20High%20Resolution%20Icon%20Pack/Windows%20XP%20Icons/Information.png');
}

/* Confirmation Dialog */
.xp-confirm-wrapper {
    text-align: center;
}

.xp-confirm-question {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.xp-confirm-message {
    font-size: 12px;
    color: #666;
}

.xp-confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* Input Dialog */
.xp-input-dialog input[type="text"],
.xp-input-dialog input[type="password"],
.xp-input-dialog input[type="email"],
.xp-input-dialog input[type="number"] {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #7f9db9;
    margin-top: 10px;
    font-size: 12px;
    font-family: Tahoma, sans-serif;
    background: white;
}

.xp-input-dialog input:focus {
    border-color: #316ac5;
    outline: 1px solid #316ac5;
}

.xp-input-dialog label {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
    color: #333;
    font-family: Tahoma, sans-serif;
}

.xp-input-dialog .required {
    color: #ff0000;
    margin-left: 2px;
}

/* Loading Dialog */
.xp-loading-dialog {
    text-align: center;
    padding: 30px 20px;
}

.xp-loading-spinner {
    width: 32px;
    height: 32px;
    margin: 20px auto;
    background: url('../images/bootloader.gif') no-repeat center;
    background-size: contain;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.xp-loading-text {
    font-size: 12px;
    color: #333;
    margin-top: 15px;
    font-family: Tahoma, sans-serif;
}

/* Modal Dialog (non-closable) */
.xp-dialog-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
}

.xp-dialog-modal .xp-dialog-overlay {
    background: transparent;
    animation: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .xp-dialog {
        min-width: 250px;
        max-width: 90%;
    }
    
    .xp-dialog-buttons {
        flex-wrap: wrap;
    }
    
    .xp-btn {
        flex: 1;
        min-width: 60px;
    }
}

/* Disabled State */
.xp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.xp-btn:disabled:hover {
    background: linear-gradient(to bottom, #ffffff 0%, #ece9d8 100%);
    border-color: #003c74;
}

/* Button with Icon */
.xp-btn-icon {
    display: flex;
    align-items: center;
    gap: 5px;
}

.xp-btn-icon .xp-btn-icon-img {
    width: 16px;
    height: 16px;
}

/* Toast Notification */
.xp-toast {
    position: fixed;
    bottom: 50px;
    right: 20px;
    background: #ffffcc;
    border: 1px solid #ffcc00;
    padding: 12px 20px;
    border-radius: 3px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 12px;
    font-family: Tahoma, sans-serif;
    z-index: 10003;
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.xp-toast-close {
    float: right;
    cursor: pointer;
    color: #666;
    font-weight: bold;
    margin-left: 10px;
}

.xp-toast-close:hover {
    color: #000;
}
