/**
 * VW Order Notify for Telegram - Admin Styles
 *
 * @package VW_Order_Notify_For_Telegram
 */

/* ================================
   CSS Variables
   ================================ */
:root {
    --vw-ton-primary: #0088cc;
    --vw-ton-primary-hover: #006699;
    --vw-ton-success: #28a745;
    --vw-ton-danger: #dc3545;
    --vw-ton-warning: #ffc107;
    --vw-ton-gray-100: #f8f9fa;
    --vw-ton-gray-200: #e9ecef;
    --vw-ton-gray-300: #dee2e6;
    --vw-ton-gray-600: #6c757d;
    --vw-ton-gray-800: #343a40;
    --vw-ton-border-radius: 8px;
    --vw-ton-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --vw-ton-transition: all 0.3s ease;
}

/* ================================
   Base Layout
   ================================ */
.vw-ton-wrap {
    max-width: 1400px;
    margin: 0;
    padding: 20px 20px 20px 0;
}

.vw-ton-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d2137 50%, #0a1929 100%);
    border-radius: 16px;
    padding: 0;
    margin-bottom: 30px;
    color: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    overflow: hidden;
    position: relative;
}

.vw-ton-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 136, 204, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(138, 43, 226, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.vw-ton-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    position: relative;
    z-index: 1;
}

.vw-ton-header-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.vw-ton-header-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    backdrop-filter: blur(10px);
}

.vw-ton-header-text h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.vw-ton-tagline {
    margin: 6px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.vw-ton-header-badge {
    display: flex;
    align-items: center;
}

.vw-ton-version-badge {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================
   Container & Grid
   ================================ */
.vw-ton-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

.vw-ton-main {
    min-width: 0;
}

.vw-ton-sidebar {
    position: sticky;
    top: 32px;
}

/* ================================
   Cards
   ================================ */
.vw-ton-card {
    background: #fff;
    border: 1px solid var(--vw-ton-gray-200);
    border-radius: var(--vw-ton-border-radius);
    margin-bottom: 20px;
    box-shadow: var(--vw-ton-box-shadow);
    overflow: hidden;
}

.vw-ton-card-header {
    background: var(--vw-ton-gray-100);
    padding: 15px 20px;
    border-bottom: 1px solid var(--vw-ton-gray-200);
}

.vw-ton-card-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--vw-ton-gray-800);
}

.vw-ton-card-body {
    padding: 20px;
}

/* ================================
   Form Fields
   ================================ */
.vw-ton-field {
    margin-bottom: 20px;
}

.vw-ton-field:last-child {
    margin-bottom: 0;
}

.vw-ton-field > label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--vw-ton-gray-800);
}

.vw-ton-field .required {
    color: var(--vw-ton-danger);
}

.vw-ton-field input[type="text"],
.vw-ton-field textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--vw-ton-gray-300);
    border-radius: 4px;
    font-size: 14px;
    transition: var(--vw-ton-transition);
    box-sizing: border-box;
}

.vw-ton-field input[type="text"]:focus,
.vw-ton-field textarea:focus {
    border-color: var(--vw-ton-primary);
    box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.2);
    outline: none;
}

.vw-ton-field .description {
    margin-top: 8px;
    color: var(--vw-ton-gray-600);
    font-size: 13px;
}

.vw-ton-field .description a {
    color: var(--vw-ton-primary);
    text-decoration: none;
}

.vw-ton-field .description a:hover {
    text-decoration: underline;
}

/* ================================
   Toggle Switch - Modern Style
   ================================ */
.vw-ton-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
    user-select: none;
}

.vw-ton-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.vw-ton-toggle-slider {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
    background: linear-gradient(135deg, #cfd8dc, #b0bec5);
    border-radius: 28px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.vw-ton-toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.vw-ton-toggle-slider::after {
    content: '✕';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #78909c;
    font-weight: bold;
    transition: all 0.3s ease;
}

.vw-ton-toggle input[type="checkbox"]:checked + .vw-ton-toggle-slider {
    background: linear-gradient(135deg, #4caf50, #43a047);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 12px rgba(76, 175, 80, 0.4);
}

.vw-ton-toggle input[type="checkbox"]:checked + .vw-ton-toggle-slider::before {
    transform: translateX(28px);
    background: linear-gradient(135deg, #ffffff, #e8f5e9);
}

.vw-ton-toggle input[type="checkbox"]:checked + .vw-ton-toggle-slider::after {
    content: '✓';
    right: auto;
    left: 10px;
    color: #fff;
}

.vw-ton-toggle:hover .vw-ton-toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 8px rgba(0, 0, 0, 0.15);
}

.vw-ton-toggle input[type="checkbox"]:checked:hover + .vw-ton-toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 16px rgba(76, 175, 80, 0.5);
}

.vw-ton-toggle-label {
    font-weight: 600;
    color: var(--vw-ton-gray-800);
    font-size: 15px;
    line-height: 1.4;
}

/* ================================
   Checkbox
   ================================ */
.vw-ton-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}

.vw-ton-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.vw-ton-checkbox span {
    font-weight: 500;
    color: var(--vw-ton-gray-800);
}

/* ================================
   Test Button
   ================================ */
#vw-ton-test-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--vw-ton-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--vw-ton-transition);
    font-size: 14px;
}

#vw-ton-test-button:hover {
    background: var(--vw-ton-primary-hover);
    color: #fff;
}

#vw-ton-test-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#vw-ton-test-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

.vw-ton-test-result {
    display: inline-block;
    margin-left: 15px;
    font-size: 14px;
    font-weight: 500;
}

.vw-ton-test-result.success {
    color: var(--vw-ton-success);
}

.vw-ton-test-result.error {
    color: var(--vw-ton-danger);
}

/* Button Group */
.vw-ton-button-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.vw-ton-button-group .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vw-ton-button-group .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

.vw-ton-test-result.loading {
    color: var(--vw-ton-gray-600);
}


/* ================================
   Placeholders Grid
   ================================ */
.vw-ton-placeholders {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--vw-ton-gray-200);
}

.vw-ton-placeholders h4 {
    margin: 0 0 15px;
    font-size: 14px;
    font-weight: 600;
    color: var(--vw-ton-gray-800);
}

.vw-ton-placeholder-section-title {
    margin: 15px 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.vw-ton-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.vw-ton-placeholder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--vw-ton-gray-100);
    border-radius: 4px;
    font-size: 13px;
}

.vw-ton-placeholder-item code {
    background: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--vw-ton-primary);
    cursor: pointer;
    transition: var(--vw-ton-transition);
}

.vw-ton-placeholder-item code:hover {
    background: var(--vw-ton-primary);
    color: #fff;
}

.vw-ton-placeholder-item span {
    color: var(--vw-ton-gray-600);
}

/* ================================
   Formatting Tips
   ================================ */
.vw-ton-formatting-tips {
    margin-top: 15px;
    padding: 15px;
    background: #fff8e1;
    border-radius: 4px;
    border-left: 4px solid var(--vw-ton-warning);
}

.vw-ton-formatting-tips h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--vw-ton-gray-800);
}

.vw-ton-formatting-tips ul {
    margin: 0;
    padding-left: 20px;
}

.vw-ton-formatting-tips li {
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--vw-ton-gray-600);
}

.vw-ton-formatting-tips code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* ================================
   Submit Button
   ================================ */
.vw-ton-submit {
    margin-top: 10px;
}

.vw-ton-submit .button-primary {
    padding: 10px 30px;
    height: auto;
    font-size: 15px;
    font-weight: 600;
}

/* ================================
   Sidebar Cards
   ================================ */
.vw-ton-help-card .vw-ton-card-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.vw-ton-help-card .vw-ton-card-header h2 {
    color: #fff;
}

.vw-ton-setup-steps {
    margin: 0;
    padding-left: 20px;
}

.vw-ton-setup-steps li {
    margin-bottom: 15px;
    line-height: 1.5;
}

.vw-ton-setup-steps li:last-child {
    margin-bottom: 0;
}

.vw-ton-setup-steps strong {
    display: block;
    color: var(--vw-ton-gray-800);
    margin-bottom: 5px;
}

.vw-ton-setup-steps p {
    margin: 0;
    font-size: 13px;
    color: var(--vw-ton-gray-600);
}

.vw-ton-setup-steps a {
    color: var(--vw-ton-primary);
    text-decoration: none;
}

.vw-ton-setup-steps a:hover {
    text-decoration: underline;
}

.vw-ton-about-card .vw-ton-card-body p {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--vw-ton-gray-600);
}

.vw-ton-about-card .vw-ton-card-body p:last-child {
    margin-bottom: 0;
}

.vw-ton-about-card a {
    color: var(--vw-ton-primary);
    text-decoration: none;
}

.vw-ton-about-card a:hover {
    text-decoration: underline;
}

/* ================================
   Responsive Design
   ================================ */

/* Tablets */
@media screen and (max-width: 1200px) {
    .vw-ton-container {
        grid-template-columns: 1fr 300px;
        gap: 20px;
    }
}

/* Small Tablets & Large Phones */
@media screen and (max-width: 960px) {
    .vw-ton-wrap {
        padding: 15px 15px 15px 0;
    }

    .vw-ton-container {
        grid-template-columns: 1fr;
    }

    .vw-ton-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .vw-ton-placeholder-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Phones */
@media screen and (max-width: 782px) {
    .vw-ton-wrap {
        padding: 10px;
        margin-left: -10px;
    }

    .vw-ton-header {
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .vw-ton-header-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 15px;
    }

    .vw-ton-header-title {
        gap: 15px;
    }

    .vw-ton-header-logo {
        width: 50px;
        height: 50px;
    }

    .vw-ton-header-text h1 {
        font-size: 20px;
    }

    .vw-ton-tagline {
        font-size: 12px;
    }

    .vw-ton-version-badge {
        padding: 6px 12px;
        font-size: 11px;
    }

    .vw-ton-sidebar {
        grid-template-columns: 1fr;
    }

    .vw-ton-card-body {
        padding: 15px;
    }

    .vw-ton-placeholder-grid {
        grid-template-columns: 1fr;
    }

    .vw-ton-placeholder-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .vw-ton-toggle {
        flex-wrap: nowrap;
    }

    .vw-ton-toggle-label {
        flex: 1;
    }

    #vw-ton-test-button {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .vw-ton-test-result {
        display: block;
        margin: 10px 0 0;
        text-align: center;
    }

    .vw-ton-submit .button-primary {
        width: 100%;
        text-align: center;
    }
}

/* Very Small Phones */
@media screen and (max-width: 480px) {
    .vw-ton-header-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .vw-ton-header-text h1 {
        font-size: 18px;
    }

    .vw-ton-card-header {
        padding: 12px 15px;
    }

    .vw-ton-card-header h2 {
        font-size: 14px;
    }

    .vw-ton-field > label {
        font-size: 14px;
    }

    .vw-ton-field input[type="text"],
    .vw-ton-field textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ================================
   WordPress Admin Bar Adjustment
   ================================ */
@media screen and (max-width: 600px) {
    .vw-ton-sidebar {
        top: 46px;
    }
}

/* ================================
   Print Styles
   ================================ */
@media print {
    .vw-ton-wrap {
        max-width: 100%;
    }

    .vw-ton-header {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .vw-ton-sidebar {
        display: none;
    }

    .vw-ton-container {
        grid-template-columns: 1fr;
    }
}

/* ================================
   Dark Mode Support (Optional)
   ================================ */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed in future */
}

/* ================================
   Accessibility
   ================================ */
.vw-ton-toggle:focus-within .vw-ton-toggle-slider {
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.3);
    outline: 2px solid var(--vw-ton-primary);
    outline-offset: 2px;
}

.vw-ton-checkbox input:focus {
    outline: 2px solid var(--vw-ton-primary);
    outline-offset: 2px;
}

#vw-ton-test-button:focus {
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.3);
    outline: none;
}

/* ================================
   Animation
   ================================ */
@keyframes vw-ton-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.vw-ton-loading .dashicons {
    animation: vw-ton-spin 1s linear infinite;
}

/* ================================
   RTL Support
   ================================ */
[dir="rtl"] .vw-ton-wrap {
    padding: 20px 0 20px 20px;
}

[dir="rtl"] .vw-ton-toggle-slider::before {
    left: auto;
    right: 3px;
}

[dir="rtl"] .vw-ton-toggle input[type="checkbox"]:checked + .vw-ton-toggle-slider::before {
    transform: translateX(-28px);
}

[dir="rtl"] .vw-ton-toggle-slider::after {
    right: auto;
    left: 8px;
}

[dir="rtl"] .vw-ton-toggle input[type="checkbox"]:checked + .vw-ton-toggle-slider::after {
    left: auto;
    right: 10px;
}

[dir="rtl"] .vw-ton-test-result {
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .vw-ton-setup-steps {
    padding-left: 0;
    padding-right: 20px;
}

[dir="rtl"] .vw-ton-formatting-tips {
    border-left: none;
    border-right: 4px solid var(--vw-ton-warning);
}

[dir="rtl"] .vw-ton-formatting-tips ul {
    padding-left: 0;
    padding-right: 20px;
}
