/*
 * Copyright 2006-2007 by Massimiliano Mirra
 * 
 * This file is part of SamePlace.
 * 
 * SamePlace is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 3 of the License, or (at your
 * option) any later version.
 * 
 * SamePlace is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * The interactive user interfaces in modified source and object code
 * versions of this program must display Appropriate Legal Notices, as
 * required under Section 5 of the GNU General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU General Public License
 * version 3, modified versions must display the "Powered by SamePlace"
 * logo to users in a legible manner and the GPLv3 text must be made
 * available to them.
 * 
 * Author: Massimiliano Mirra, <bard [at] hyperstruct [dot] net>
 *  
 */


@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@namespace html url("http://www.w3.org/1999/xhtml");

/* GENERAL */

notificationbox {
    overflow: hidden;
}


/* CONTACT LIST */

#contacts {
    background: #f8f8f8;
    margin: 0px;
}

#contacts scrollbar {
    /* works in Firefox2.  needs run-time application of ./scrollbars.css in Firefox3. */
    display: none;
}

#contacts .scrollbox-innerbox {
    /* make room for upper control */
    margin-top: 56px;
}


/* HEADERS */

#contacts .header {
    -moz-box-pack: center;
    font-size: 9px;
    font-weight: bold;
    border-bottom: 1px solid rgb(237,237,237);
}

#contacts .header:not(.active) {
    display: none;
}


/* CONTACT */

#contacts .contact {
    padding: 2px 4px 2px 4px;
    border-top: 1px solid transparent;
    border-bottom: 1px solid rgb(227,227,227);
}

#contacts .header[current="true"],
#contacts .header[selected="true"],
#contacts .contact[current="true"],
#contacts .contact[selected="true"] {
    background: white;
    color: black;
}

#contacts .contact:hover {
    background: rgb(241,241,241);
}

#contacts .contact.dragover {
    border-color: #aaa;
}


/* CONTACT CONTENT */

/* avatar area */

#contacts .contact .avatar-stack {
    margin-top: 4px;
    margin-left: 2px;
    width: 52px;
    height: 58px;
}

#contacts .contact .avatar-stack .avatar-box {
    -moz-box-align: center;
    -moz-box-pack: start;
}

/* avatar area -> small name (visible when no avatar available) */

#contacts .contact .avatar-stack .small-name {
    margin: 51px 0 0 0;
    width: 48px;
    color: #444;
    font-size: 9px;
    text-align: center;
    padding: 0 2px;
}

/* avatar area -> avatar */

#contacts .contact .avatar-stack .avatar {
    width: 50px;
    height: 50px;
    -moz-border-radius: 3px;
    border: 1px solid lightgray;
    background: #fff;
}

#contacts .contact .avatar-stack .avatar:not([photo-hash]) {
    list-style-image: url("avatar-default-contact.png");
    background: transparent;
}

#contacts .contact.groupchat .avatar-stack .avatar {
    list-style-image: url("avatar-default-chatroom.png");
    background: transparent;
}


/* avatar area -> indicators (status etc.) */

#contacts .contact .avatar-stack .indicators {
    margin-left: -5px;
    margin-top: 34px;
}

#contacts .contact .avatar-stack .icon-pending {
    list-style-image: url("email.png");
    visibility: hidden;
}

#contacts .contact .avatar-stack .icon-status {
    list-style-image: url("status16x64.png");
    width: 16px;
    height: 16px;
    visibility: hidden;
}

/* presence indicator */

#contacts .contact[availability="available"][show=""] .avatar-stack .icon-status,
#contacts .contact[availability="available"][show="chat"] .avatar-stack .icon-status {
    -moz-image-region: rect(16px 16px 32px 0px);
}

#contacts .contact[availability="unavailable"] .avatar-stack .icon-status {
    visibility: visible;
    -moz-image-region: rect(48px 16px 64px 0px);
}

#contacts .contact[availability="available"][show="away"] .avatar-stack .icon-status,
#contacts .contact[availability="available"][show="xa"] .avatar-stack .icon-status {
    visibility: visible;
    -moz-image-region: rect(32px 16px 48px 0px);
}

#contacts .contact[availability="available"][show="dnd"] .avatar-stack .icon-status {
    visibility: visible;
    -moz-image-region: rect(0px 16px 16px 0px);
}

/* contact's service icon */

#contacts .contact .service {
    margin-right: 5px;
    list-style-image: url("services/server_im.png");
    opacity: 0.4;
}

#contacts .contact .service:hover {
    opacity: 0.9;
}

#contacts .contact[address$="@sameplace.cc"] .service {
    list-style-image: url("services/server_im_sameplace.png");
}

#contacts .contact[address$="@gmail.com"] .service,
#contacts .contact[address$="@googlemail.com"] .service {
    list-style-image: url("services/server_im_gtalk.png");
}

#contacts .contact[address$="@twitter.x4m.localhost"] .service {
    list-style-image: url("services/server_x-turtle-twitter.png");
}

#contacts .contact[address*="@msn."] .service {
    list-style-image: url("services/gateway_msn.png");
}

#contacts .contact[address*="@aim."] .service {
    list-style-image: url("services/gateway_aim.png");
}

/* unread messages indicator */

/*
#contacts .contact:not([pending="0"]) .icon.icon-email {
    display: -moz-box;
    list-style-image: url("email.png");
}
*/

/* contact content area */

#contacts .contact vbox.info {
    /* overflow-x: hidden; */ /* XXX not working, why? */ 
}

#contacts .contact .info label.name {
    font-size: 14px;
    color: rgb(20,20,20);
}

/*
#contacts .contact .info label.name:hover {
    text-decoration: underline;
    color: blue;
}
*/

#contacts .contact .status {
    font-size: 10px;
    color: rgb(60,60,60);
}

#contacts .contact .status label.text-link {
    margin: 0;
}

#contacts .contact .delay {
    font-style: italic;
    color: gray;
    font-size: smaller;
}

#contacts .contact vbox.extra {
    overflow: hidden;
}



/* DISPLAY MODES */

/* tiny avatars */

#view.tiny #contacts .contact .avatar-stack {
    height: 38px;
}

#view.tiny #contacts .contact .avatar-stack .indicators {
    margin-left: 1px;
    margin-top: 10px;
}

#view.tiny #contacts .contact .avatar-stack .small-name {
    margin: 28px 0 0 0;
}

#view.tiny #contacts .contact .avatar-stack .avatar {
    width: 26px;
    height: 26px;
}

/* sort by activity */

#contacts[sort="activity"] .header {
    display: none;
}

/* filtering */

#contacts-stack.filtering .contact:not([candidate="true"]),
#contacts-stack.filtering .header {
    display: none;
}

#contacts-stack.filtering .contact[selected="true"] {
    background: rgb(231,231,231);
}

/* show/hide unavailable contacts */

#contacts.hide-unavailable .contact[availability="unavailable"] {
    display: none;
}

/* compact/expanded view */

#view.compact #contacts .contact .info,
#view.compact #contacts .header,
#view.compact #status-box {
    display: none;
}

/* standalone view */

#view.standalone [command="detach-sidebar"] {
    display: none;
}


/* POPUPS */

popup.with-headers menuitem.header {
    font-weight: bold;
    color: black;
}

popup.with-headers .offset {
    padding-left: 1em;
}

#status-popup {
    max-width: 200px;
}

#contact-popup:not(.groupchat) .remove-room {
    display: none;
}

#contact-popup.groupchat .set-contact-alias,
#contact-popup.groupchat .remove-contact {
    display: none;
}




/* debug */
/*
.info:hover { background: red; padding: 0; margin: 0;}
.status:hover { background: lightgreen; }
.delay:hover { background: lightblue; padding: 0; margin: 0; line-height: 100;}
*/

#status-message {
    padding: 3px 5px 6px 5px !important;
    font-size: 11px;
    color: rgb(30,30,30);
}

#status-message.draft {
    color: graytext;
}

#status-message-counter {
    padding: 3px 5px 6px 5px !important;
    color: graytext;
    font-size: 11px;
    text-align: right;
    max-width: 3em;
}


