/* ===== ISOLATED STYLES FOR DAYS CALCULATOR ===== */
.dc-plugin-container {
    isolation: isolate;
}

.dc-calculator * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.dc-calculator {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    width: 100%;
    max-width: 100%;
    margin: 20px auto;
    padding: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

/* Header */
.dc-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 30px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.dc-title {
    color: white;
    font-size: 1.8em;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Form */
.dc-form {
    padding: 30px;
}

.dc-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.dc-input-group {
    flex: 1;
    min-width: 250px;
}

.dc-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.dc-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 16px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    max-width: 100%;
}

.dc-input:focus {
    border-color: #3498db;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.dc-number-input {
    text-align: center;
    font-weight: 600;
}

/* Readonly fields */
.dc-readonly {
    background: #e9ecef !important;
    color: #6c757d !important;
    border-color: #ced4da !important;
    cursor: not-allowed !important;
    user-select: none !important;
}

.dc-readonly:focus {
    box-shadow: none !important;
    border-color: #ced4da !important;
}

.dc-small {
    padding: 12px;
}

.dc-period-inputs {
    gap: 15px;
}

.dc-period-inputs .dc-input-group {
    min-width: 120px;
}

/* Options */
.dc-options-group {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.dc-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    color: #2c3e50;
    font-weight: 500;
}

.dc-checkbox-label input {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    accent-color: #3498db;
}

.dc-checkbox-text {
    user-select: none;
}

/* Buttons */
.dc-buttons-row {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.dc-button {
    flex: 1;
    padding: 18px 25px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dc-calculate-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.dc-calculate-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2573a7 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Results */
.dc-result-container {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.dc-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.dc-result-label {
    font-weight: 600;
    font-size: 18px;
}

.dc-result-value {
    font-size: 36px;
    font-weight: bold;
    color: #ffeb3b;
}

.dc-result-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.dc-breakdown-item {
    flex: 1;
    min-width: 160px;
    display: flex;
    justify-content: space-between;
    padding: 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 16px;
    backdrop-filter: blur(10px);
}

/* Share Section - Compact Circular Buttons */
.dc-share-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.dc-share-title {
    margin-bottom: 20px;
    font-size: 18px;
    text-align: center;
    opacity: 0.9;
}

.dc-share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.dc-share-btn {
    width: 55px;
    height: 55px;
    border: none;
    border-radius: 50%;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

.dc-share-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.dc-vk { background: linear-gradient(135deg, #4a76a8 0%, #3b5998 100%); }
.dc-telegram { background: linear-gradient(135deg, #0088cc 0%, #0077b5 100%); }
.dc-whatsapp { background: linear-gradient(135deg, #25d366 0%, #128c7e 100%); }
/* Светлый фон для кнопки копирования ссылки */
.dc-copy-link { background: linear-gradient(135deg, #a0aec0 0%, #cbd5e0 100%); }

/* Исправление для иконок - используем символы вместо текста */
.dc-share-icon {
    font-size: 24px;
    font-weight: normal;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Специальные стили для иконки ссылки - темный цвет для контраста */
.dc-copy-link .dc-share-icon {
    font-size: 26px;
    color: #2d3748; /* Темный цвет для контраста на светлом фоне */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Notification - Fixed high z-index */
.dc-notification {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #27ae60;
    color: white;
    padding: 18px 35px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.4);
    z-index: 100000;
    animation: dc-slideDown 0.5s ease;
    font-weight: 600;
    text-align: center;
    min-width: 320px;
    border: 2px solid #219653;
    font-size: 16px;
}

.dc-notification-text {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
}

@keyframes dc-slideDown {
    from {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes dc-slideOut {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
}

/* Messages */
.dc-message {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    animation: dc-slideIn 0.3s ease;
    position: relative;
    z-index: 10;
}

.dc-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.dc-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media screen and (max-width: 768px) {
    .dc-calculator {
        margin: 10px 0;
        border-radius: 12px;
    }
    
    .dc-header {
        padding: 20px;
    }
    
    .dc-title {
        font-size: 1.5em;
    }
    
    .dc-form {
        padding: 20px;
    }
    
    .dc-input-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .dc-input-group {
        min-width: 100%;
    }
    
    .dc-period-inputs {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .dc-period-inputs .dc-input-group {
        min-width: calc(33.333% - 10px);
    }
    
    .dc-result-breakdown {
        flex-direction: column;
    }
    
    .dc-breakdown-item {
        min-width: 100%;
    }
    
    .dc-share-buttons {
        gap: 10px;
    }
    
    .dc-share-btn {
        width: 50px;
        height: 50px;
    }
    
    .dc-share-icon {
        font-size: 22px;
    }
    
    .dc-copy-link .dc-share-icon {
        font-size: 24px;
    }
    
    .dc-notification {
        top: 20px;
        min-width: 280px;
        padding: 15px 25px;
        font-size: 15px;
    }
}

@media screen and (max-width: 480px) {
    .dc-header {
        padding: 15px;
    }
    
    .dc-title {
        font-size: 1.3em;
    }
    
    .dc-form {
        padding: 15px;
    }
    
    .dc-period-inputs {
        flex-direction: column;
    }
    
    .dc-period-inputs .dc-input-group {
        min-width: 100%;
    }
    
    .dc-input {
        padding: 12px;
    }
    
    .dc-button {
        padding: 15px;
        font-size: 16px;
    }
    
    .dc-result-value {
        font-size: 28px;
    }
    
    .dc-share-buttons {
        justify-content: space-around;
    }
    
    .dc-share-btn {
        width: 45px;
        height: 45px;
    }
    
    .dc-share-icon {
        font-size: 20px;
    }
    
    .dc-copy-link .dc-share-icon {
        font-size: 22px;
    }
    
    .dc-notification {
        top: 15px;
        min-width: 250px;
        padding: 12px 20px;
        font-size: 14px;
        left: 10px;
        right: 10px;
        transform: none;
        width: calc(100% - 20px);
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .dc-calculator {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .dc-label {
        color: #e2e8f0;
    }
    
    .dc-input {
        background: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .dc-readonly {
        background: #2d3748 !important;
        color: #a0aec0 !important;
        border-color: #4a5568 !important;
    }
    
    .dc-options-group {
        background: #4a5568;
    }
    
    .dc-checkbox-text {
        color: #e2e8f0;
    }
    
    /* Для темной темы - темный фон для кнопки копирования */
    .dc-copy-link { 
        background: linear-gradient(135deg, #4a5568 0%, #718096 100%); 
    }
    
    .dc-copy-link .dc-share-icon {
        color: #e2e8f0; /* Светлый цвет для темной темы */
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .dc-input {
        font-size: 16px;
        min-height: 48px;
    }
    
    .dc-button, .dc-share-btn {
        min-height: 48px;
    }
    
    .dc-share-btn:active {
        transform: scale(0.95);
    }
    
    .dc-readonly {
        pointer-events: none;
    }
}